Skip to content

Commit

Permalink
ci: adjust docker tag
Browse files Browse the repository at this point in the history
  • Loading branch information
ItaloMedici authored Aug 27, 2024
1 parent 994d773 commit 19a8d35
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ name: Create and publish a Docker image

on:
push:
branches: ['release']
branches:
- 'main'
tags:
- 'v*'
workflow_dispatch:


env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
VERSION: latest

jobs:
build-and-push-image:
Expand All @@ -35,15 +37,15 @@ jobs:
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
id: push
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
tags: ${{ github.event_name == 'workflow_dispatch' && 'latest' || steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
secrets: |
"NEXTAUTH_URL=${{ secrets.NEXTAUTH_URL }}"
Expand All @@ -57,6 +59,6 @@ jobs:
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}:${{ env.VERSION }}
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

0 comments on commit 19a8d35

Please sign in to comment.