Skip to content

Commit

Permalink
env not supported in matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
ptr727 committed Jun 18, 2023
1 parent 8d48f3c commit d7a16aa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/BuildDockerPush.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand Down Expand Up @@ -94,24 +95,24 @@ 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
platforms: linux/amd64,linux/arm64
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
platforms: linux/amd64
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
Expand All @@ -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:

Expand Down Expand Up @@ -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 }}
Expand All @@ -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:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/BuildGitHubRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand Down

0 comments on commit d7a16aa

Please sign in to comment.