-
Notifications
You must be signed in to change notification settings - Fork 6
95 lines (81 loc) · 3.04 KB
/
deploy-dev.yml
File metadata and controls
95 lines (81 loc) · 3.04 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
86
87
88
89
90
91
92
93
94
95
name: deploy (dev)
on:
push:
branches:
- 'master'
- 'main'
- 'edge'
- 'deploy'
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest
# queued. But do not cancel in-progress runs - we want these deploymeents to complete.
concurrency:
group: 'deploy'
cancel-in-progress: false
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
deploy:
environment:
name: github-pages
url: ${{ vars.SITE_URL }}
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Check out repo
uses: actions/checkout@v6
with:
# Only fetch files we actually need:
fetch-depth: 0
filter: 'blob:none'
# Node is required for npm
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: "20" # FIXME: this is very old and out-of-date. Bump the version!
- name: Cache ~/.npm
uses: actions/cache@v5
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node
- name: Clean-install dependencies
run: npm ci
- name: Preprocess documentation variant (full)
run: npm run preprocess-full
- name: Cache Docusaurus build
uses: actions/cache@v5
with:
path: |
${{ github.workspace }}/.docusaurus
${{ github.workspace }}/**/.cache
key: |
${{ runner.os }}-docusaurus-full-${{ hashFiles('**/package-lock.json', '**/npm-shrinkwrap.json', '**/yarn.lock', '**/pnpm-lock.yaml') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
restore-keys: |
${{ runner.os }}-docusaurus-full-${{ hashFiles('**/package-lock.json', '**/npm-shrinkwrap.json', '**/yarn.lock', '**/pnpm-lock.yaml') }}
- name: Build documentation
env:
VARIANT: full
RELEASE_CHANNEL: ${{ vars.RELEASE_CHANNEL }} # NOTE: this is expected to be set by the deployment environment!
SITE_URL: ${{ vars.SITE_URL }} # NOTE: this is expected to be set by the deployment environment!
run: |
BUILD_DATE="$(git show -s --format=%cs ${GITHUB_SHA})" npm run build
- name: Generate redirects for legacy URLs
if: vars.RELEASE_CHANNEL == 'development' # only because openuc2.github.io redirects to the dev release channel's website
env:
VARIANT: full
run: npm run postprocess-external-redirects
- name: Set up Pages
id: pages
uses: actions/configure-pages@v6
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: ./build
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5