-
Notifications
You must be signed in to change notification settings - Fork 61
49 lines (42 loc) · 1.61 KB
/
reference-staging.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
name: Generate ReadMe Staging 🦉
on:
# when a PR is created in any branch except main that have made changes to the
# reference folder, run this workflow
push:
branches-ignore:
- main
pull_request:
paths:
- 'reference/**'
jobs:
# ////////////////////////////////////////////////////////////////////////
# Pull Request
# ////////////////////////////////////////////////////////////////////////
# Create a new ReadMe Version if it needs to
rdme-staging:
runs-on: ubuntu-latest
outputs:
has-version: ${{ steps.check-readme-version.outputs.has-version }}
steps:
- name: Check out repo 📚
uses: actions/checkout@v3
- name: Install rdme
run: |
npm install -g rdme
- name: Check if the readme version exists
id: check-readme-version
run: |
if rdme versions --version=${{ github.event.pull_request.number }} --key=${{ secrets.README_API_KEY }}; then
echo "has-version=true" >> $GITHUB_ENV
else
echo "has-version=false" >> $GITHUB_ENV
fi
- name: Run create readme version
if: steps.has-version.outputs.has-version == 'false'
uses: readmeio/rdme@v8
with:
rdme: versions:create ${{ github.event.pull_request.number }} --key=${{ secrets.README_API_KEY }} --fork=v3.26 --main=false --beta=false --deprecated=false --isPublic=true
- name: Push docs to staging env 🚀
uses: readmeio/rdme@v8
with:
rdme: docs ./reference --key=${{ secrets.README_API_KEY }} --version=${{ github.event.pull_request.number }}