diff --git a/.github/workflows/py-shiny.yml b/.github/workflows/py-shiny.yml index ebacb89..7cb199c 100644 --- a/.github/workflows/py-shiny.yml +++ b/.github/workflows/py-shiny.yml @@ -31,6 +31,15 @@ jobs: org.opencontainers.image.title=Faithful org.opencontainers.image.description=Old Faithful Shiny app org.opencontainers.image.vendor=Hosting Shiny Book Project + images: | + ghcr.io/${{ github.repository }}/${{ env.SHINY_SETUP }} + tags: | + type=raw,value=latest,enable={{is_default_branch}} + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=ref,event=branch + type=ref,event=pr - name: 'Login to GitHub Container Registry' uses: docker/login-action@v3 @@ -44,8 +53,6 @@ jobs: with: context: ./${{ env.SHINY_SETUP }} file: ./${{ env.SHINY_SETUP }}/Dockerfile - push: true - tags: | - ghcr.io/${{ github.repository }}/${{ env.SHINY_SETUP }}:${{ github.ref_name }} - ghcr.io/${{ github.repository }}/${{ env.SHINY_SETUP }}:latest + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/r-shiny.yml b/.github/workflows/r-shiny.yml index b7d325c..833e3a5 100644 --- a/.github/workflows/r-shiny.yml +++ b/.github/workflows/r-shiny.yml @@ -31,6 +31,15 @@ jobs: org.opencontainers.image.title=Faithful org.opencontainers.image.description=Old Faithful Shiny app org.opencontainers.image.vendor=Hosting Shiny Book Project + images: | + ghcr.io/${{ github.repository }}/${{ env.SHINY_SETUP }} + tags: | + type=raw,value=latest,enable={{is_default_branch}} + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=ref,event=branch + type=ref,event=pr - name: 'Login to GitHub Container Registry' uses: docker/login-action@v3 @@ -44,8 +53,6 @@ jobs: with: context: ./${{ env.SHINY_SETUP }} file: ./${{ env.SHINY_SETUP }}/Dockerfile - push: true - tags: | - ghcr.io/${{ github.repository }}/${{ env.SHINY_SETUP }}:${{ github.ref_name }} - ghcr.io/${{ github.repository }}/${{ env.SHINY_SETUP }}:latest + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}