From 003cd1da3cce54451aff474420d3a004ec5364f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Birger=20J=2E=20Nord=C3=B8lum?= Date: Sat, 20 Nov 2021 11:28:03 +0100 Subject: [PATCH] chore: Publish container image on release (#285) --- .github/workflows/build-image.yaml | 39 ++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/build-image.yaml diff --git a/.github/workflows/build-image.yaml b/.github/workflows/build-image.yaml new file mode 100644 index 000000000..ddfe09469 --- /dev/null +++ b/.github/workflows/build-image.yaml @@ -0,0 +1,39 @@ +--- +name: publish container image + +on: + push: + branches: + - master + release: + types: + - created + workflow_dispatch: + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Set tag for image + run: | + echo IMAGE_TAG=$([ ${{ github.ref_type }} == 'tag' ] && echo ${{ github.ref_name }} || echo 'latest') >> $GITHUB_ENV + - name: Build and Push + uses: docker/build-push-action@v2 + with: + context: . + platforms: linux/amd64 + push: true + tags: | + ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }}