Skip to content

Commit fca365e

Browse files
authored
Use GitHub action for deploying pages (#10)
* Use GitHub action for deploying pages * Deploy only on main branch --------- Co-authored-by: kaklakariada <[email protected]>
1 parent b88e094 commit fca365e

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

.github/workflows/gh-pages.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ on:
77
pull_request:
88

99
jobs:
10-
deploy:
10+
build:
1111
runs-on: ubuntu-24.04
1212
concurrency:
1313
group: ${{ github.workflow }}-${{ github.ref }}
1414
permissions:
15-
contents: write
15+
contents: read
1616
steps:
1717
- uses: actions/checkout@v4
1818
with:
@@ -25,9 +25,22 @@ jobs:
2525
- name: Build
2626
run: hugo --minify
2727

28-
- name: Deploy
29-
uses: peaceiris/actions-gh-pages@v3
30-
if: github.ref == 'refs/heads/main'
28+
- name: Upload artifact
29+
uses: actions/upload-pages-artifact@v3
3130
with:
32-
github_token: ${{ secrets.GITHUB_TOKEN }}
33-
publish_dir: ./public
31+
path: ./public/
32+
33+
deploy:
34+
if: ${{ github.ref == 'refs/heads/main' }}
35+
needs: build
36+
runs-on: ubuntu-24.04
37+
permissions:
38+
pages: write # to deploy to Pages
39+
id-token: write # to verify the deployment originates from an appropriate source
40+
environment:
41+
name: github-pages
42+
url: ${{ steps.deployment.outputs.page_url }}
43+
steps:
44+
- name: Deploy to GitHub Pages
45+
id: deployment
46+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)