hasura-rest-hands-on/.github/workflows/github-pages.yml

41 lines
1.1 KiB
YAML
Raw Normal View History

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'
2021-07-16 22:11:10 +09:00
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
2022-03-02 16:25:03 +09:00
- uses: actions/setup-node@v2
with: { node-version: lts/*, cache: yarn }
2021-07-17 11:23:29 +09:00
- id: brew_cache
run: echo "::set-output name=dir::$(brew --cache)"
- uses: actions/cache@v2
with:
path: ${{ steps.brew_cache.outputs.dir }}
key: brew-${{ hashFiles('**/Brewfile.lock.json') }}
restore-keys: brew-
2021-07-16 22:11:10 +09:00
- name: Git config
run: |
git config user.name bot
git config user.email bot@example
2022-03-02 16:25:03 +09:00
git subtree add --prefix book origin gh-pages
- name: Build assets
run: |
yarn install
yarn build
- name: Build book
run: |
brew bundle
mdbook build
2021-07-16 22:11:10 +09:00
- name: Publish
run: |
git add -f book
if git commit -m update; then
git subtree push --prefix book origin gh-pages
fi