@@ -2,8 +2,7 @@ name: Deploy website
2
2
3
3
on :
4
4
push :
5
- branches :
6
- - main
5
+ branches : ["main"]
7
6
8
7
workflow_dispatch :
9
8
@@ -12,28 +11,55 @@ permissions:
12
11
pages : write
13
12
id-token : write
14
13
14
+ concurrency :
15
+ group : " pages"
16
+ cancel-in-progress : false
17
+
18
+ defaults :
19
+ run :
20
+ shell : bash
21
+
15
22
jobs :
16
- deploy :
23
+ build :
17
24
runs-on : ubuntu-latest
18
- concurrency :
19
- group : ${{ github.workflow }}-${{ github.ref }}
25
+ env :
26
+ HUGO_VERSION : 0.128.0
20
27
steps :
21
- - uses : actions/checkout@v4
28
+ - name : Install Hugo CLI
29
+ run : |
30
+ wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
31
+ && sudo dpkg -i ${{ runner.temp }}/hugo.deb
32
+ - name : Install Dart Sass
33
+ run : sudo snap install dart-sass
34
+ - name : Checkout
35
+ uses : actions/checkout@v4
22
36
with :
23
- submodules : true
24
- fetch-depth : 0
25
-
26
- - name : Setup Hugo
27
- uses : peaceiris/actions-hugo@v3
37
+ submodules : recursive
38
+ - name : Setup Pages
39
+ id : pages
40
+ uses : actions/configure-pages@v5
41
+ - name : Install Node.js dependencies
42
+ run : " [[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
43
+ - name : Build with Hugo
44
+ env :
45
+ HUGO_CACHEDIR : ${{ runner.temp }}/hugo_cache
46
+ HUGO_ENVIRONMENT : production
47
+ run : |
48
+ hugo \
49
+ --minify \
50
+ --baseURL "${{ steps.pages.outputs.base_url }}/"
51
+ - name : Upload artifact
52
+ uses : actions/upload-pages-artifact@v3
28
53
with :
29
- hugo-version : ' latest'
30
-
31
- - name : Build
32
- run : hugo --minify
54
+ path : ./public
33
55
34
- - name : Deploy
35
- uses : peaceiris/actions-gh-pages@v3
36
- if : github.ref == 'refs/heads/main'
37
- with :
38
- github_token : ${{ secrets.GITHUB_TOKEN }}
39
- publish_dir : ./public
56
+ deploy :
57
+ environment :
58
+ name : github-pages
59
+ url : ${{ steps.deployment.outputs.page_url }}
60
+ runs-on : ubuntu-latest
61
+ needs : build
62
+ steps :
63
+ - name : Deploy to GitHub Pages
64
+ id : deployment
65
+ uses : actions/deploy-pages@v4
0 commit comments