Skip to content

Commit 72a2d95

Browse files
committed
fix: use deploy pages GH
1 parent 1866017 commit 72a2d95

1 file changed

Lines changed: 25 additions & 9 deletions

File tree

.github/workflows/publish-site.yml

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@ on:
55
branches: [ main ]
66
workflow_dispatch: {}
77

8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
813
jobs:
9-
build-and-publish:
14+
build:
15+
name: Build static site
1016
runs-on: ubuntu-latest
1117
steps:
1218
- name: Checkout
@@ -17,15 +23,25 @@ jobs:
1723
with:
1824
python-version: '3.x'
1925

20-
- name: Build site
26+
- name: Install dependencies
2127
run: |
2228
python3 -m pip install --upgrade pip
23-
python3 website/build_site.py
29+
if [ -f requirements.txt ]; then pip3 install -r requirements.txt; fi
30+
31+
- name: Build site
32+
run: python3 website/build_site.py
2433

25-
- name: Publish to gh-pages
26-
uses: peaceiris/actions-gh-pages@v3
34+
- name: Upload Pages artifact
35+
uses: actions/upload-pages-artifact@v1
2736
with:
28-
github_token: ${{ secrets.GITHUB_TOKEN }}
29-
publish_dir: ./website/dist
30-
publish_branch: gh-pages
31-
allow_empty_commit: true
37+
path: website/dist
38+
39+
deploy:
40+
name: Deploy to GitHub Pages
41+
runs-on: ubuntu-latest
42+
needs: build
43+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
44+
environment: github-pages
45+
steps:
46+
- name: Deploy artifact
47+
uses: actions/deploy-pages@v1

0 commit comments

Comments
 (0)