1
- name : Hugo Build
1
+ name : Deploy to GitHub Pages
2
2
3
3
on :
4
+ # Trigger the workflow every time you push to the `main` branch
5
+ # Using a different branch name? Replace `main` with your branch’s name
4
6
push :
5
- branches :
6
- - hugo # Set a branch to deploy
7
- pull_request :
7
+ branches : [astro]
8
+ # Allows you to run this workflow manually from the Actions tab on GitHub.
9
+ workflow_dispatch :
8
10
9
- jobs :
10
- deploy :
11
- runs-on : ubuntu-22.04
12
- permissions :
13
- contents : write
14
- concurrency :
15
- group : ${{ github.workflow }}-${{ github.ref }}
16
-
17
- steps :
18
- - uses : actions/checkout@v3
19
- with :
20
- submodules : true # Fetch Hugo themes (true OR recursive)
11
+ # Allow this job to clone the repo and create a page deployment
12
+ permissions :
13
+ contents : read
14
+ pages : write
15
+ id-token : write
21
16
22
- - name : Setup Hugo
23
- uses : peaceiris/actions-hugo@v2
24
- with :
25
- hugo-version : ' 0.110.0'
26
- # extended: true
17
+ # Allow one concurrent deployment
18
+ concurrency :
19
+ group : " pages"
20
+ cancel-in-progress : true
27
21
28
- - name : Build
29
- run : |
30
- env HUGO_ENV="production" hugo --minify --baseURL "https://emeraldjava.github.io/"
22
+ jobs :
23
+ build :
24
+ runs-on : ubuntu-latest
25
+ steps :
26
+ - name : Checkout your repository using git
27
+ uses : actions/checkout@v4
28
+ - name : Install, build, and upload your site output
29
+ uses : withastro/action@v2
31
30
32
- - name : Deploy
33
- uses : peaceiris/actions-gh-pages@v3
34
- if : ${{ github.ref == 'refs/heads/hugo' }}
35
- with :
36
- github_token : ${{ secrets.GITHUB_TOKEN }}
37
- publish_dir : ./public
38
- publish_branch : gh-pages
31
+ deploy :
32
+ needs : build
33
+ runs-on : ubuntu-latest
34
+ environment :
35
+ name : github-pages
36
+ url : ${{ steps.deployment.outputs.page_url }}
37
+ steps :
38
+ - name : Deploy to GitHub Pages
39
+ id : deployment
40
+ uses : actions/deploy-pages@v4
0 commit comments