Skip to content

Commit 6834ff9

Browse files
committed
Use actions/deploy-pages to deploy mdbook output
1 parent e66fda2 commit 6834ff9

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

.github/workflows/deploy.yml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
- master
66

77
jobs:
8-
deploy:
8+
build:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v3
@@ -19,16 +19,23 @@ jobs:
1919
- name: Generate Book
2020
run: |
2121
./generate-book.py
22-
- name: Deploy GitHub Pages
23-
run: |
24-
git worktree add gh-pages gh-pages
25-
git config user.name "Deploy from CI"
26-
git config user.email ""
27-
cd gh-pages
28-
# Delete the ref to avoid keeping history.
29-
git update-ref -d refs/heads/gh-pages
30-
rm -rf *
31-
mv ../book/* .
32-
git add .
33-
git commit -m "Deploy $GITHUB_SHA to gh-pages"
34-
git push --force
22+
- name: Upload Artifact
23+
uses: actions/upload-pages-artifact@v1.0.8
24+
with:
25+
path: ./book
26+
27+
deploy:
28+
needs: build
29+
30+
permissions:
31+
pages: write
32+
id-token: write
33+
34+
environment:
35+
name: github-pages
36+
url: ${{ steps.deployment.outputs.page_url }}
37+
38+
runs-on: ubuntu-latest
39+
steps:
40+
- id: deployment
41+
uses: actions/deploy-pages@v2.0.0

0 commit comments

Comments
 (0)