-
-
Notifications
You must be signed in to change notification settings - Fork 36
65 lines (60 loc) · 1.67 KB
/
docs-deploy.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
63
64
65
name: Documentation Deployment
on:
push:
branches:
- 'main'
workflow_dispatch:
# Allow this job to clone the repo and create a page deployment
permissions:
contents: read
pages: write
id-token: write
jobs:
docs-changed:
runs-on: ubuntu-latest
outputs:
files: ${{ contains(steps.files.outputs.added_modified, 'apps/docs/') }}
steps:
- name: Get All Added and Modified Field
id: files
if: ${{ github.event_name != 'workflow_dispatch' }}
uses: jitterbit/get-changed-files@v1
- name: Echo contains
if: ${{ github.event_name != 'workflow_dispatch' }}
run: echo ${{ contains(steps.files.outputs.added_modified, 'apps/docs/') }}
build-docs:
runs-on: ubuntu-latest
needs:
- docs-changed
if: ${{ needs.docs-changed.outputs.files == 'true' || github.event_name == 'workflow_dispatch' }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: Install pnpm
run: npm i -g pnpm
- name: Dependencies Install
run: pnpm i
- name: Build Docs
run: pnpm nx build docs
- name: Upload build
uses: actions/upload-pages-artifact@v1
with:
name: github-pages
path: dist/apps/docs/
if-no-files-found: error
docs-deploy:
runs-on: ubuntu-latest
needs:
- build-docs
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: GitHub Pages Deploy Step
uses: actions/deploy-pages@v2
id: deployment