-
Notifications
You must be signed in to change notification settings - Fork 27
85 lines (71 loc) · 2.42 KB
/
documentation.yml
File metadata and controls
85 lines (71 loc) · 2.42 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Documentation
on:
workflow_dispatch:
workflow_call:
inputs:
publish-folder:
type: string
env:
PUBLISH_FOLDER: ${{ inputs.publish-folder || github.ref_name }}
PUBLISH_APP: ${{ github.ref == 'refs/heads/master' }}
PUBLISH_DOCS: true
jobs:
build-artifacts:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Dependencies
uses: ./.github/actions/install-dependencies
# Bypassing Jekyll processing on GitHub Pages by adding .nojekyll to read folders that start with an underscore
- name: Build Nextra Docs
if: ${{ env.PUBLISH_DOCS == 'true' }}
env:
NEXTRA_BASE_PATH: /uikit-docs/${{ env.PUBLISH_FOLDER }}
run: npm run build:nextra && touch ${{ github.workspace }}/apps/docs/dist/.nojekyll
- name: Archive Nextra Docs
if: ${{ env.PUBLISH_DOCS == 'true' }}
uses: actions/upload-artifact@v4
with:
name: nextra-docs
path: ${{ github.workspace }}/apps/docs/dist
retention-days: 2
- name: Build App
if: ${{ env.PUBLISH_APP == 'true' }}
run: npm run build -w apps/app -- --base=/uikit-app/${{ env.PUBLISH_FOLDER }}/
- name: Archive App
if: ${{ env.PUBLISH_APP == 'true' }}
uses: actions/upload-artifact@v4
with:
name: uikit-app
path: ${{ github.workspace }}/apps/app/dist
retention-days: 2
deploy-artifacts:
name: Deploy
runs-on: ubuntu-latest
needs: build-artifacts
concurrency:
group: docs-deployment
cancel-in-progress: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Deploy Docs
if: ${{ env.PUBLISH_DOCS == 'true' }}
uses: ./.github/actions/deploy-artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_GHPAGES_DEPLOY_KEY: ${{ secrets.ORG_GHPAGES_DEPLOY_KEY }}
PUBLISH_FOLDER: uikit-docs/${{ env.PUBLISH_FOLDER }}
ARTIFACT: nextra-docs
- name: Deploy App
if: ${{ env.PUBLISH_APP == 'true' }}
uses: ./.github/actions/deploy-artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_GHPAGES_DEPLOY_KEY: ${{ secrets.ORG_GHPAGES_DEPLOY_KEY }}
PUBLISH_FOLDER: uikit-app/${{ env.PUBLISH_FOLDER }}
ARTIFACT: uikit-app