Skip to content

Commit

Permalink
Fix master builds (#20)
Browse files Browse the repository at this point in the history
* Fix master builds

* Always run configured image build
  • Loading branch information
ngreatorex authored Oct 21, 2023
1 parent 094877a commit 26d0149
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@ jobs:
name: Configure jobs
runs-on: ubuntu-latest
env:
docker.io-image: ngreatorex/homie-streamdeck
docker-hub-image: ngreatorex/homie-streamdeck
ghcr-image: ghcr.io/ngreatorex/homie-streamdeck
steps:
- name: Checkout
uses: actions/checkout@v4
- id: set-matrix
- id: set-configs
name: Enumerate all configured Dockerfiles
run: |
echo "matrix=$(ls -l config/Dockerfile.* | grep '^-' | awk -F ' ' '{print $9}' | { read x; echo "${x##*.}"; } | jq -R -s -c 'split("\n") | map(select(length > 0))')" >> $GITHUB_OUTPUT
echo "configs=$(ls -l config/Dockerfile.* | grep '^-' | awk -F ' ' '{print $9}' | { read x; echo "${x##*.}"; } | jq -R -s -c 'split("\n") | map(select(length > 0))')" >> $GITHUB_OUTPUT
- id: set-image
name: Choose repository for Docker image
run: |
[ "${{ github.event_name == 'pull_request' }}" = "true" ] && echo "image=${{ env.ghcr-image }}" >> $GITHUB_OUTPUT || true
[ "${{ github.event_name != 'pull_request' }}" = "true" ] && echo "image=${{ env.docker.io-image }}" >> $GITHUB_OUTPUT || true
[ "${{ github.event_name != 'pull_request' }}" = "true" ] && echo "image=${{ env.docker-hub-image }}" >> $GITHUB_OUTPUT || true
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
configs: ${{ steps.set-configs.outputs.configs }}
image: ${{ steps.set-image.outputs.image }}

build-base-image:
Expand All @@ -51,14 +51,13 @@ jobs:

build-configured-images:
name: Build configured images
#if: "github.event_name != 'pull_request'"
needs:
- configure-jobs
- build-base-image
strategy:
fail-fast: false
matrix:
config-name: ${{ fromJson(needs.configure-jobs.outputs.matrix) }}
config-name: ${{ fromJson(needs.configure-jobs.outputs.configs) }}
uses: ./.github/workflows/build-docker-image.yml
with:
build-args: |
Expand Down

0 comments on commit 26d0149

Please sign in to comment.