Skip to content

Commit 6584787

Browse files
authored
Merge pull request #5 from daaa1k/improve-deploy-action
Improve deploy action
2 parents 2e8c496 + e4f5f8e commit 6584787

3 files changed

Lines changed: 41 additions & 16 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

book.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ src = "text-ja"
55
title = "実例によるPureScript"
66

77
[output.html]
8-
git-repository-url = "https://github.com/gemmaro/purescript-book"
8+
git-repository-url = "https://github.com/purs-jp/purescript-book"
99
mathjax-support = true

translation/po/ja.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#
1515
msgid ""
1616
msgstr ""
17-
"Project-Id-Version: com.github.gemmaro.purescript-book.v0.1.0\n"
17+
"Project-Id-Version: com.github.purs-jp.purescript-book.v0.1.0\n"
1818
"POT-Creation-Date: 2024-08-05 08:18+0900\n"
1919
"PO-Revision-Date: 2024-08-05 08:25+0900\n"
2020
"Last-Translator: gemmaro <gemmaro.dev@gmail.com>\n"

0 commit comments

Comments
 (0)