Skip to content

Commit f83d86d

Browse files
committed
Trigger docker build when buildinfo.json is updated
1 parent 18a4834 commit f83d86d

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

.github/workflows/docker-build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
- master
77
paths:
88
- buildinfo.json
9+
workflow_call:
910
# workaround for #526
1011
workflow_dispatch:
1112

.github/workflows/update.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,32 @@ jobs:
99
check:
1010
runs-on: ubuntu-latest
1111
if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository == 'factoriotools/factorio-docker')
12+
outputs:
13+
updated: ${{ steps.changes.outputs.updated }}
1214

1315
steps:
1416
- name: Checkout
1517
uses: actions/checkout@v6
1618

19+
- name: Save current HEAD
20+
id: before
21+
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
22+
1723
- name: Run update script
1824
run: ./update.sh
1925
shell: bash
26+
27+
- name: Check for changes
28+
id: changes
29+
run: |
30+
if [ "$(git rev-parse HEAD)" != "${{ steps.before.outputs.sha }}" ]; then
31+
echo "updated=true" >> "$GITHUB_OUTPUT"
32+
else
33+
echo "updated=false" >> "$GITHUB_OUTPUT"
34+
fi
35+
36+
build:
37+
needs: check
38+
if: needs.check.outputs.updated == 'true'
39+
uses: ./.github/workflows/docker-build.yml
40+
secrets: inherit

0 commit comments

Comments
 (0)