-
Notifications
You must be signed in to change notification settings - Fork 12
52 lines (52 loc) · 1.66 KB
/
docs.yml
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
45
46
47
48
49
50
51
52
name: Deploy API Spec
on:
release:
types: [published]
push:
branches:
- draft
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Inject env variables
uses: rlespinasse/github-slug-action@v3.x
- uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- uses: actions/checkout@v3
- run: |
npm install
npm run build
- name: clone gh-pages and clean-up
if: ${{ env.GITHUB_REF_SLUG == 'master' }}
run: |
git clone --branch gh-pages https://github.com/Open-EO/openeo-api.git gh-pages
find gh-pages -maxdepth 1 -type f -delete
rm -rf gh-pages/assets/
- name: create empty gh-pages folder
if: ${{ env.GITHUB_REF_SLUG != 'master' }}
run: mkdir gh-pages
- run: |
cp redoc.html gh-pages/index.html
cp errors.json gh-pages/errors.json
cp -rv assets/. gh-pages/assets/
- name: deploy to root (master)
uses: peaceiris/actions-gh-pages@v3
if: ${{ env.GITHUB_REF_SLUG == 'master' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
keep_files: true
publish_dir: gh-pages
user_name: 'openEO CI'
user_email: openeo.ci@uni-muenster.de
- name: deploy to ${{ env.GITHUB_REF_SLUG }}
uses: peaceiris/actions-gh-pages@v3
if: ${{ env.GITHUB_REF_SLUG != 'master' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: gh-pages
destination_dir: ${{ env.GITHUB_REF_SLUG }}
user_name: 'openEO CI'
user_email: openeo.ci@uni-muenster.de