-
Notifications
You must be signed in to change notification settings - Fork 15
42 lines (38 loc) · 1.35 KB
/
Copy pathpublish-spec-develop.yml
File metadata and controls
42 lines (38 loc) · 1.35 KB
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
name: publish-spec-develop
# Publish of beta specs happens on prerelease.
on:
release:
types:
- prereleased
jobs:
build:
if: github.repository == 'alaress/schoolbox-api-docs'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: gh-pages
- uses: actions/checkout@v3
- uses: actions/setup-node@v3.1.0
- name: Push to gh-pages branch
id: publish-spec-develop
run: |
# Commit on behalf of the github-actions bot
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
# Copy docs into gh-pages repo
# Also copy openapi/ and .redocly.yaml (for building docs)
mkdir .staging/
cp -r docs/ openapi/ .redocly.yaml .staging
git checkout -- .
git checkout gh-pages
cp -r .staging/* .
rm -rf .staging/
# Build the docs (do not set beta specs as the most recently selected)
npm ci
npm run rebuild-builds-list
npm run build --build-version=${{ github.ref_name }}
# Commit and push
git add -f docs/builds docs/builds.json
git commit --allow-empty -m "Publish spec for production release ${{ github.ref_name }}" .
git push