diff --git a/.github/workflows/BuildDockerPush.yml b/.github/workflows/BuildDockerPush.yml index 343c6df3..8a82cda0 100644 --- a/.github/workflows/BuildDockerPush.yml +++ b/.github/workflows/BuildDockerPush.yml @@ -13,6 +13,7 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +# env is not supported in matrix operations :( env: # Do not push on pull_request events dopush: ${{ github.event_name != 'pull_request' }} @@ -94,7 +95,7 @@ jobs: cache-scope: debian secrets: SAVOURY_PPA_AUTH tags: | - docker.io/ptr727/plexcleaner:${{ env.mainbranch && 'debian' || 'debian-develop' }} + docker.io/ptr727/plexcleaner:${{ endsWith(github.ref, 'refs/heads/main') && 'debian' || 'debian-develop' }} # Alpine: linux/amd64,linux/arm64 - file: ./Docker/Alpine.dotNET.Dockerfile @@ -102,7 +103,7 @@ jobs: cache-scope: alpine secrets: SAVOURY_PPA_AUTH tags: | - docker.io/ptr727/plexcleaner:${{ env.mainbranch && 'alpine' || 'alpine-develop' }} + docker.io/ptr727/plexcleaner:${{ endsWith(github.ref, 'refs/heads/main') && 'alpine' || 'alpine-develop' }} # Ubuntu: linux/amd64 - file: ./Docker/Ubuntu.dotNET.Savoury.Dockerfile @@ -110,8 +111,8 @@ jobs: cache-scope: savoury secrets: SAVOURY_PPA_AUTH tags: | - docker.io/ptr727/plexcleaner:${{ env.mainbranch && 'savoury' || 'savoury-develop' }} - docker.io/ptr727/plexcleaner:${{ env.mainbranch && 'latest' || 'develop' }} + docker.io/ptr727/plexcleaner:${{ endsWith(github.ref, 'refs/heads/main') && 'savoury' || 'savoury-develop' }} + docker.io/ptr727/plexcleaner:${{ endsWith(github.ref, 'refs/heads/main') && 'latest' || 'develop' }} docker.io/ptr727/plexcleaner:${{ needs.version.outputs.SemVer2 }} # Arch: linux/amd64 @@ -120,7 +121,7 @@ jobs: cache-scope: arch secrets: SAVOURY_PPA_AUTH tags: | - docker.io/ptr727/plexcleaner:${{ env.mainbranch && 'arch' || 'arch-develop' }} + docker.io/ptr727/plexcleaner:${{ endsWith(github.ref, 'refs/heads/main') && 'arch' || 'arch-develop' }} steps: @@ -166,9 +167,7 @@ jobs: cache-from: type=gha,scope=${{ matrix.cache-scope }} cache-to: type=gha,mode=max,scope=${{ matrix.cache-scope }} file: ${{ matrix.file }} - # Don't push pull requests - # push: ${{ (github.event_name != 'pull_request') }} - push: ${{ env.dopush }} + push: ${{ (github.event_name != 'pull_request') }} # TODO: How to test for secret not null and avoid "null= is not a valid secret" secrets: ${{ matrix.secrets }}=${{ secrets[matrix.secrets] }} tags: ${{ matrix.tags }} @@ -195,13 +194,13 @@ jobs: # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs matrix: include: - - tag: ${{ env.mainbranch && 'debian' || 'debian-develop' }} + - tag: ${{ endsWith(github.ref, 'refs/heads/main') && 'debian' || 'debian-develop' }} file: debian.ver - - tag: ${{ env.mainbranch && 'alpine' || 'alpine-develop' }} + - tag: ${{ endsWith(github.ref, 'refs/heads/main') && 'alpine' || 'alpine-develop' }} file: alpine.ver - - tag: ${{ env.mainbranch && 'savoury' || 'savoury-develop' }} + - tag: ${{ endsWith(github.ref, 'refs/heads/main') && 'savoury' || 'savoury-develop' }} file: savoury.ver - - tag: ${{ env.mainbranch && 'arch' || 'arch-develop' }} + - tag: ${{ endsWith(github.ref, 'refs/heads/main') && 'arch' || 'arch-develop' }} file: arch.ver steps: diff --git a/.github/workflows/BuildGitHubRelease.yml b/.github/workflows/BuildGitHubRelease.yml index c4f22936..cd2c73bc 100644 --- a/.github/workflows/BuildGitHubRelease.yml +++ b/.github/workflows/BuildGitHubRelease.yml @@ -11,6 +11,7 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +# env is not supported in matrix operations :( env: # Do not push on pull_request events dopush: ${{ github.event_name != 'pull_request' }}