diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml index 7c4b74f3..0ac4d653 100644 --- a/.github/workflows/deploy-image.yml +++ b/.github/workflows/deploy-image.yml @@ -3,6 +3,7 @@ name: Build and publish Docker image on: push: branches: + - dev - main tags: - "v*.*.*" @@ -29,21 +30,27 @@ jobs: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@v4 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | + # Will publish image tagged `vX.Y.Z` on each release tag + # `latest` by default refers to image built on latest release type=semver,pattern={{version}} - type=edge,branch=main - + # Will publish image tagged `edge` on each push to `dev` + type=edge,branch=dev + # Will publish image tagged `main` on each push to `main` + type=ref,event=branch + - name: Build and push Docker image uses: docker/build-push-action@v4 with: context: . platforms: linux/amd64,linux/arm64 push: true - tags: ${{ steps.meta.outputs.tags }} + tags: ${{ steps.meta.outputs.tags }} cache-from: type=gha cache-to: type=gha,mode=max