From 37e1ae70448f6534e081a1726311e462ad54e2ef Mon Sep 17 00:00:00 2001 From: Peter Solymos Date: Thu, 4 Jul 2024 21:44:07 -0600 Subject: [PATCH] Update yml Signed-off-by: Peter Solymos --- .github/workflows/py-shiny.yml | 15 +++++++++++---- .github/workflows/r-shiny.yml | 15 +++++++++++---- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/py-shiny.yml b/.github/workflows/py-shiny.yml index be53b6b..85581fc 100644 --- a/.github/workflows/py-shiny.yml +++ b/.github/workflows/py-shiny.yml @@ -31,6 +31,15 @@ jobs: org.opencontainers.image.title=LB Test org.opencontainers.image.description=Load balancing test 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 f989baf..ebd9659 100644 --- a/.github/workflows/r-shiny.yml +++ b/.github/workflows/r-shiny.yml @@ -31,6 +31,15 @@ jobs: org.opencontainers.image.title=LB Test org.opencontainers.image.description=Load balancing test 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 }}