25
25
push :
26
26
branches :
27
27
- main # Set a branch to deploy
28
+
28
29
schedule :
29
30
- cron : " 0 3 * * *"
30
31
32
+ workflow_dispatch :
33
+
34
+ permissions :
35
+ contents : read
36
+ pages : write
37
+ id-token : write
38
+
39
+ defaults :
40
+ run :
41
+ shell : bash
42
+
31
43
env :
32
44
# ----------------------------------------------------------------------------
33
45
# Specify the deployment environment: staging or production
34
- hugoEnvironment : production
46
+ hugoEnvironment : staging
47
+ HUGO_VERSION : 0.133.1
35
48
36
49
jobs :
37
50
# ----------------------------------------------------------------------------
42
55
outputs :
43
56
zoteroVersion : ${{ fromJson(steps.zoteroVersion.outputs.headers).last-modified-version }}
44
57
cacheHit : ${{ steps.cache-zotero-bib.outputs.cache-hit }}
58
+
45
59
runs-on : ubuntu-latest
46
60
concurrency :
47
61
group : ${{ github.workflow }}-${{ github.ref }}
74
88
runs-on : ubuntu-latest
75
89
if : github.event_name == 'push' || needs.check.outputs.cacheHit != 'true'
76
90
steps :
77
- - uses : actions/checkout@v4
91
+ - uses : actions/checkout@v4A
92
+ with :
93
+ submodules : recursive
94
+ fetch-depth : 0
78
95
79
96
- name : Cache Zotero Bibliography
80
97
id : cache-zotero-bib
@@ -102,13 +119,24 @@ jobs:
102
119
./update_bibliography.sh
103
120
sudo cp --recursive ${GITHUB_WORKSPACE}/static/data ~/data
104
121
fi
105
- shell : bash
106
122
107
- - name : Setup Hugo
108
- uses : peaceiris/actions-hugo@v3
109
- with :
110
- hugo-version : ' 0.133.1'
111
- extended : true
123
+ - name : Install Dart Sass
124
+ run : sudo snap install dart-sass
125
+
126
+ - name : Install Hugo CLI
127
+ run : |
128
+ wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
129
+ && sudo dpkg -i ${{ runner.temp }}/hugo.deb
130
+
131
+ # - name: Setup Hugo
132
+ # uses: peaceiris/actions-hugo@v3
133
+ # with:
134
+ # hugo-version: ${{ HUGO_VERSION }}
135
+ # extended: true
136
+
137
+ - name : Setup Pages
138
+ id : pages
139
+ uses : actions/configure-pages@v5
112
140
113
141
- name : Setup Node
114
142
uses : actions/setup-node@v4
@@ -120,7 +148,16 @@ jobs:
120
148
- run : npm install --verbose
121
149
122
150
- name : Build
123
- run : hugo -e staging
151
+ env :
152
+ HUGOENVIRONMENT : staging
153
+ HUGO_CACHEDIR : ${{ runner.temp }}/hugo_cache
154
+ TZ : America/New York
155
+ run : hugo --gc
156
+
157
+ # - name: Upload artifact
158
+ # uses: actions/upload-pages-artifact@v3
159
+ # with:
160
+ # path: ./public
124
161
125
162
- name : Deploy
126
163
uses : peaceiris/actions-gh-pages@v4
0 commit comments