From d581b4f0c4c9ae71062f6a9c0d49e47fad025a00 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Sat, 5 Mar 2022 22:47:11 +0100 Subject: [PATCH] feat: add CI to automatically update theme --- .github/workflows/main.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..ba5304f --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,30 @@ +name: Update theme + +# Controls when the workflow will run +on: + schedule: + # Update theme automatically everyday at 00:00 UTC + - cron: "0 0 * * *" + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Setup Hugo + uses: peaceiris/actions-hugo@v2 + with: + hugo-version: "latest" + extended: true + + - name: Update theme + run: hugo mod get -u github.com/CaiJimmy/hugo-theme-stack/v3 + + - name: Commit changes + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: "CI: Update theme"