-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (51 loc) · 1.45 KB
/
github_pages.yml
File metadata and controls
51 lines (51 loc) · 1.45 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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: GitHub Pages
on:
workflow_dispatch:
inputs: {}
push:
branches: [master]
pull_request:
branches: [master]
schedule:
# At 00:01 on day-of-month 1 in January
# https://crontab.guru/#1_0_1_1_*
- cron: 1 0 1 1 *
timezone: Australia/Melbourne
jobs:
pages:
runs-on: ubuntu-latest
concurrency:
group: ${{github.workflow}}-${{github.ref}}
steps:
- name: Pull Source Code
uses: actions/checkout@v6
with:
submodules: true
fetch-depth: 0
- name: Set-up Hugo
uses: peaceiris/actions-hugo@v3
with:
# hugo-version: latest
hugo-version: "0.148.1"
extended: true
- name: Cache
uses: actions/cache@v5
with:
path: /home/runner/.cache/hugo_cache
key: ${{runner.os}}-hugomod-${{hashFiles('**/go.sum')}}
restore-keys: ${{runner.os}}-hugomod-
- name: Build
env:
HUGO_ENVIRONMENT: production
HUGO_ENV: production
GOOGLE_ANALYTICS: ${{secrets.GOOGLE_ANALYTICS}}
run: |
printf "\ngoogleAnalytics: $GOOGLE_ANALYTICS" >> hugo.yml
make website
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/master'
with:
github_token: ${{secrets.GITHUB_TOKEN}}
publish_dir: ./public