jest-hands-on/.github/workflows/github-pages.yml

35 lines
950 B
YAML
Raw Normal View History

2022-02-24 17:06:32 +09:00
name: github-pages
on:
workflow_run:
branches: [main]
workflows: [test]
types: [completed]
jobs:
main:
2022-02-24 17:51:47 +09:00
if: github.event.workflow_run.conclusion == 'success'
2022-02-24 17:06:32 +09:00
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
2022-02-24 17:06:32 +09:00
- id: brew_cache
run: echo "::set-output name=dir::$(brew --cache)"
- uses: actions/cache@v3
2022-02-24 17:06:32 +09:00
with:
path: ${{ steps.brew_cache.outputs.dir }}
key: brew-${{ hashFiles('**/Brewfile.lock.json') }}
restore-keys: brew-
- name: Git config
run: |
git config user.name bot
git config user.email bot@example
git subtree add --prefix book origin gh-pages
- name: Build
run: |
brew bundle
mdbook build
- name: Publish
run: |
git add -f book
if git commit -m update; then
git subtree push --prefix book origin gh-pages
fi