Repository navigation
73 lines (60 loc) · 1.99 KB
/
Copy pathupdate-submodules.yml
File metadata and controls
73 lines (60 loc) · 1.99 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Update Hugo modules
on:
workflow_dispatch:
schedule:
- cron: "5 0 * * *"
concurrency:
group: update-hugo-modules
cancel-in-progress: false
env:
GO_VERSION: "1.27.1"
HUGO_VERSION: "0.166.0"
PYTHON_VERSION: "3.14"
jobs:
update:
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: write
steps:
- uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
id: app-token
with:
client-id: ${{ vars.WEBSITE_UPDATER_CLIENT_ID }}
private-key: ${{ secrets.WEBSITE_UPDATER_KEY }}
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
submodules: false
lfs: false
token: ${{ steps.app-token.outputs.token }}
- name: Set up Go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: go.sum
- name: Set up Hugo
uses: peaceiris/actions-hugo@2752ce1d29631191ea3f27c23495fa06139a5b78 # v3
with:
hugo-version: ${{ env.HUGO_VERSION }}
extended: true
- name: Set up Python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Synchronize Hugo module revisions
run: python3 tools/sync_hugo_modules.py
- name: Verify updated modules
run: hugo mod verify
- name: Commit and push update
run: |
if git diff --quiet -- go.mod go.sum; then
echo "Hugo modules are already up to date."
exit 0
fi
git config --local user.name "precice-bot"
git config --local user.email "info@precice.org"
git add go.mod go.sum
git commit --message "Update Hugo modules"
git push origin "HEAD:${GITHUB_REF_NAME}"