forked from zopanix/docker_factorio_server
-
Notifications
You must be signed in to change notification settings - Fork 269
40 lines (33 loc) · 1013 Bytes
/
update.yml
File metadata and controls
40 lines (33 loc) · 1013 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Check Update
on:
schedule:
- cron: "0 * * * *"
workflow_dispatch:
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