diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 08593067..c006c040 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -6,6 +6,7 @@ on: - master paths: - buildinfo.json + workflow_call: # workaround for #526 workflow_dispatch: diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index ab6af805..2b373e2c 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -9,11 +9,32 @@ jobs: check: runs-on: ubuntu-latest if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository == 'factoriotools/factorio-docker') + outputs: + updated: ${{ steps.changes.outputs.updated }} steps: - name: Checkout uses: actions/checkout@v6 + - name: Save current HEAD + id: before + run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" + - name: Run update script run: ./update.sh shell: bash + + - name: Check for changes + id: changes + run: | + if [ "$(git rev-parse HEAD)" != "${{ steps.before.outputs.sha }}" ]; then + echo "updated=true" >> "$GITHUB_OUTPUT" + else + echo "updated=false" >> "$GITHUB_OUTPUT" + fi + + build: + needs: check + if: needs.check.outputs.updated == 'true' + uses: ./.github/workflows/docker-build.yml + secrets: inherit