Skip to content

Commit 79a6ef3

Browse files
committed
Update build/deploy workflow to use official actions
To improve stability of workflow
1 parent 2e8c496 commit 79a6ef3

1 file changed

Lines changed: 39 additions & 14 deletions

File tree

.github/workflows/mdbook.yml

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,30 @@ on:
66
# branches: [master]
77
pull_request:
88

9+
workflow_dispatch:
10+
911
permissions:
10-
contents: write
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
concurrency:
17+
group: "pages"
18+
cancel-in-progress: false
1119

1220
jobs:
13-
deploy:
21+
build:
1422
runs-on: ubuntu-latest
23+
env:
24+
MDBOOK_VERSION: 0.5.2
1525
steps:
1626
- uses: actions/checkout@v4
1727

18-
- name: Setup mdBook
19-
uses: peaceiris/actions-mdbook@v2
20-
with:
21-
mdbook-version: 'latest'
28+
- name: Install mdBook
29+
run: |
30+
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf -y | sh
31+
rustup update
32+
cargo install --version ${MDBOOK_VERSION} mdbook
2233
2334
- name: Set up PureScript toolchain
2435
uses: purescript-contrib/setup-purescript@main
@@ -31,13 +42,27 @@ jobs:
3142
echo -e "PureScript v$version\n" >> README.md
3243
echo -e "Published on $today" >> README.md
3344
34-
- run: mdbook build
45+
- name: Setup Pages
46+
id: pages
47+
uses: actions/configure-pages@v5
3548

36-
- name: Deploy
37-
uses: peaceiris/actions-gh-pages@v4
38-
if: github.ref == 'refs/heads/ja'
39-
# if: github.ref == 'refs/heads/master'
49+
- name: Build with mdBook
50+
run: mdbook build
51+
52+
- name: Upload artifact
53+
uses: actions/upload-pages-artifact@v3
4054
with:
41-
github_token: ${{ secrets.GITHUB_TOKEN }}
42-
publish_dir: ./book
43-
# cname: book.purescript.org
55+
path: ./book
56+
57+
deploy:
58+
if: github.ref == 'refs/heads/ja'
59+
# if: github.ref == 'refs/heads/master'
60+
environment:
61+
name: github-pages
62+
url: ${{ steps.deployment.outputs.page_url }}
63+
runs-on: ubuntu-latest
64+
needs: build
65+
steps:
66+
- name: Deploy to GitHub Pages
67+
id: deployment
68+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)