-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (44 loc) · 1.14 KB
/
publish.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
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