-
-
Notifications
You must be signed in to change notification settings - Fork 198
42 lines (42 loc) · 1.54 KB
/
update-themes.yml
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
name: Update themes
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
env:
HUGO_VERSION: "v0.125.6"
jobs:
build:
runs-on: ubuntu-latest
# Use bash shell for all steps in the workflow
defaults:
run:
shell: bash
env:
HUGO_CACHEDIR: /tmp/hugo_cache
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "^1.21.0"
- name: Update submodules
working-directory: ./cmd/hugothemesitebuilder
run: |
go install github.com/gohugoio/hugo@${{ env.HUGO_VERSION }}
go run main.go build -skipSiteBuild -cleanCache
cd build
hugo mod get
hugo mod tidy
- name: Commit & push changes
# Check the github.ref context to determine the current branch name. if it is 'refs/heads/main', then commit and push the changes.
# This allows experimenting/debugging GitHub actions without concerns about committing changes.
# For example, changes can be made to this workflow in a separate branch and a workflow run can be triggered manually (workflow_dispatch).
# For more information, see https://docs.github.com/en/actions/learn-github-actions/contexts
if: ${{ github.ref == 'refs/heads/main' }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "bep"
git add .
git commit -am "[Bot] Update themes"
git push --force-with-lease