publish #33
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: publish | |
on: | |
repository_dispatch: | |
types: | |
- on_demand | |
workflow_run: | |
workflows: | |
- test | |
types: | |
- completed | |
branches: | |
- master | |
jobs: | |
publish: | |
name: Publish to GitHub Pages | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
cache: yarn | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Fetch API documentation | |
run: | | |
curl -SsL "https://raw.githubusercontent.com/${ORG}/${REPO}/${BRANCH}/${FILE_PATH}" \ | |
-H "Authorization: token ${GITHUB_TOKEN}" \ | |
-o src/spec/openapi.yaml \ | |
env: | |
ORG: StatusCakeDev | |
REPO: openapi | |
BRANCH: master | |
FILE_PATH: api/statuscake/service/statuscake/openapi.yaml | |
GITHUB_TOKEN: ${{ secrets.MACHINE_TOKEN }} | |
- name: Build website | |
run: yarn build | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./build |