docs: Enhance Docusaurus example workflow (#234)

- Add on.push.paths
- Add defaults.run.working-directory
  - https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#defaultsrun
  - https://github.blog/changelog/2020-04-15-github-actions-new-workflow-features/
This commit is contained in:
Shohei Ueda 2020-04-17 09:27:11 +09:00 committed by GitHub
parent 4f693f0ddb
commit 63cdebd96b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -680,12 +680,21 @@ An example workflow for [Docusaurus](https://docusaurus.io/).
`npx @docusaurus/init@next init website classic` is useful to create a new Docusaurus project. `npx @docusaurus/init@next init website classic` is useful to create a new Docusaurus project.
```yaml ```yaml
# .github/workflows/deploy.yml
name: github pages name: github pages
on: on:
push: push:
branches: branches:
- master - master
paths:
- '.github/workflows/deploy.yml'
- 'website/**'
defaults:
run:
working-directory: website
jobs: jobs:
deploy: deploy:
@ -711,9 +720,7 @@ jobs:
${{ runner.os }}-yarn- ${{ runner.os }}-yarn-
- run: yarn install - run: yarn install
working-directory: ./website
- run: yarn build - run: yarn build
working-directory: ./website
- name: Deploy - name: Deploy
uses: peaceiris/actions-gh-pages@v3 uses: peaceiris/actions-gh-pages@v3