-
-
Notifications
You must be signed in to change notification settings - Fork 17
62 lines (61 loc) · 1.8 KB
/
gh_pages.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
53
54
55
56
57
58
59
60
61
62
name: Update api docs
on:
push:
branches:
- docs
release:
types: [published]
workflow_dispatch:
inputs:
path:
description: 'Path to generate'
required: false
jobs:
build:
name: Update api docs
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v3
with:
cache: 'npm'
node-version: '16.x'
- run: npm install -g npm@7.11.2
continue-on-error: true
- uses: actions/checkout@v3
with:
path: source
- uses: actions/checkout@v3
with:
ref: gh-pages
path: yeoman-test-doc
- run: npm ci
working-directory: source
- run: npm config set yeoman-test:doc_path ../yeoman-test-doc/${{ github.event.inputs.path }}
working-directory: source
- run: npm run doc
working-directory: source
- name: Create commit
working-directory: yeoman-test-doc
if: always()
run: |
git add .
git config --local user.email ""
git config --local user.name "Github Actions"
git commit -a -m "Update api for ${{github.event.release.name}}" || true
- name: Create Pull Request
if: always()
id: cpr
uses: peter-evans/create-pull-request@v3.8.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'Update api for ${{github.event.release.name}}'
title: 'Update api for ${{github.event.release.name}}'
body: |
Update api docs
labels: automated pr
branch: gh-pages-master
path: yeoman-test-doc
- name: Check outputs
run: |
echo "Pull Request Number - ${{ env.PULL_REQUEST_NUMBER }}"
echo "Pull Request Number - ${{ steps.cpr.outputs.pr_number }}"