2021-07-16 22:11:10 +09:00
|
|
|
name: github-pages
|
|
|
|
on:
|
2022-03-02 16:25:03 +09:00
|
|
|
workflow_run:
|
2021-07-16 22:11:10 +09:00
|
|
|
branches: [main]
|
2022-03-02 16:25:03 +09:00
|
|
|
workflows: [test]
|
|
|
|
types: [completed]
|
2021-07-16 22:11:10 +09:00
|
|
|
jobs:
|
|
|
|
main:
|
2022-03-02 16:25:03 +09:00
|
|
|
if: github.event.workflow_run.conclusion == 'success'
|
2022-08-01 18:00:31 +09:00
|
|
|
permissions:
|
|
|
|
pages: write
|
|
|
|
id-token: write
|
|
|
|
environment: github-pages
|
2021-07-16 22:11:10 +09:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-09-01 01:14:31 +00:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
2022-03-02 16:25:03 +09:00
|
|
|
with: { node-version: lts/*, cache: yarn }
|
2022-10-01 11:42:08 +09:00
|
|
|
- uses: Homebrew/actions/setup-homebrew@master
|
2021-07-17 11:23:29 +09:00
|
|
|
- id: brew_cache
|
|
|
|
run: echo "::set-output name=dir::$(brew --cache)"
|
2022-09-01 01:14:31 +00:00
|
|
|
- uses: actions/cache@v3
|
2021-07-17 11:23:29 +09:00
|
|
|
with:
|
|
|
|
path: ${{ steps.brew_cache.outputs.dir }}
|
2022-08-01 17:46:29 +09:00
|
|
|
key: brew-v3
|
2022-03-02 16:25:03 +09:00
|
|
|
- name: Build assets
|
|
|
|
run: |
|
|
|
|
yarn install
|
|
|
|
yarn build
|
|
|
|
- name: Build book
|
|
|
|
run: |
|
|
|
|
brew bundle
|
|
|
|
mdbook build
|
2023-08-01 02:46:21 +00:00
|
|
|
- uses: actions/upload-pages-artifact@v2
|
2022-08-01 18:00:31 +09:00
|
|
|
with:
|
|
|
|
path: book
|
2023-04-01 00:35:09 +00:00
|
|
|
- uses: actions/deploy-pages@v2
|