This repository has been archived by the owner on Jan 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (56 loc) · 1.83 KB
/
pr.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: 'Pull Request'
on: ['pull_request']
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- name: Install 🔧
run: yarn
- name: Lint 👀
run: yarn lint
- name: Build 🏗️
run: yarn build
- name: Uploading docs artifact
uses: actions/upload-artifact@v2
with:
name: docs
path: public/
deploy_doc:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
- name: Download docs artifact
uses: actions/download-artifact@v2
with:
name: docs
path: tmp
- name: Publishing doc to GitHub pages
uses: JamesIves/[email protected]
with:
COMMIT_MESSAGE: 'Publish PR ${{ github.event.pull_request.number }}'
BRANCH: gh-pages
FOLDER: tmp
TARGET_FOLDER: pull/${{ github.event.pull_request.number }}
CLEAN: true
- name: Find docs URL comment
uses: peter-evans/find-comment@v1
id: find_url_comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: <!-- doc_url -->
- name: Post docs URL to PR
if: steps.find_url_comment.outputs.comment-id == 0
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
<!-- doc_url -->
## 👀 Docs deployed
See the docs for this PR at https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/pull/${{ github.event.pull_request.number }}/