intro-to-software-testing/.github/workflows/github-pages.yml
2022-02-22 17:45:22 +09:00

37 lines
1 KiB
YAML

name: github-pages
on:
push:
branches: [main]
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with: { node-version: lts/*, cache: yarn }
- 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-
- name: Installing dependencies
run: |
yarn install
brew bundle
- name: Git config
run: |
git config user.name bot
git config user.email bot@example
- name: Build
run: |
git subtree add --prefix pages origin gh-pages
yarn build
mdbook build
- name: Publish
run: |
git add -f pages
if git commit -m update; then
git subtree push --prefix pages origin gh-pages
fi