Skip to content

Commit

Permalink
feat: push docker image (#352)
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Yang <[email protected]>
  • Loading branch information
FrankYang0529 authored Oct 27, 2022
1 parent 87fe10d commit 218e4f2
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,3 +191,45 @@ jobs:
- name: Cargo publish
run: cargo publish
shell: bash
docker-image:
name: Build and push docker images
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: lowercase repository owner
run: |
echo "OWNER=${GITHUB_REPOSITORY_OWNER,,}" >>$GITHUB_ENV
- name: set the release version (tag)
if: startsWith(github.ref, 'refs/tags/v')
shell: bash
run: echo "RELEASE_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV

- name: Build and push (tag)
uses: docker/build-push-action@v3
if: startsWith(github.ref, 'refs/tags/v')
with:
push: true
tags: ghcr.io/${{ env.OWNER }}/bindle:latest,ghcr.io/${{ env.OWNER }}/bindle:${{ env.RELEASE_VERSION }}

- name: Build and push (main)
uses: docker/build-push-action@v3
if: github.ref == 'refs/heads/main'
with:
push: true
tags: ghcr.io/${{ env.OWNER }}/bindle:canary

0 comments on commit 218e4f2

Please sign in to comment.