diff options
author | Queensferry <queensferry.me@gmail.com> | 2022-03-31 10:41:17 +0300 |
---|---|---|
committer | Queensferry <queensferry.me@gmail.com> | 2022-03-31 10:51:41 +0300 |
commit | bc39ef755aae40233ce3360b9b4b979d31dc4f6c (patch) | |
tree | d63aa326cba25c1191664f7e0a5337717af32e50 | |
parent | 3933a1480c81c9dcf552522937d8af97747a028b (diff) |
ci: use gha to auto-update `exampleSite/content`
-rw-r--r-- | .github/workflows/update.yml | 25 | ||||
-rw-r--r-- | .gitignore | 1 | ||||
-rwxr-xr-x | tools/update.sh | 7 |
3 files changed, 26 insertions, 7 deletions
diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml new file mode 100644 index 0000000..c65de26 --- /dev/null +++ b/.github/workflows/update.yml @@ -0,0 +1,25 @@ +name: Update + +on: + schedule: + - cron: '0 0 * * 0' + workflow_dispatch: + +jobs: + update: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: fregante/setup-git-user@v1 + - name: Update exampleSite/content + run: | + git clone https://github.com/gohugoio/hugoBasicExample.git + rm -rf exampleSite/content + mv hugoBasicExample/content exampleSite + rm -rf hugoBasicExample + - name: Push Updates + run: | + git add . + git diff-index --quiet HEAD || git commit -m "chore: update `exampleSite/content`" + git push @@ -1,6 +1,7 @@ # Hugo output public/ resources/ +.hugo_build.lock # OS files desktop.ini diff --git a/tools/update.sh b/tools/update.sh deleted file mode 100755 index 3c7f19e..0000000 --- a/tools/update.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -git clone https://github.com/gohugoio/hugoBasicExample.git -rm -rf exampleSite/content -mv hugoBasicExample/content exampleSite -rm -rf hugoBasicExample - |