-
Notifications
You must be signed in to change notification settings - Fork 8
92 lines (79 loc) · 2.5 KB
/
ci_cd.yml
File metadata and controls
92 lines (79 loc) · 2.5 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
# Simple workflow for deploying static content to GitHub Pages
name: CI/CD
on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# Hosted GitHub runners have 7 GB of memory available, swap handles brief peaks above this
NODE_OPTIONS: --max-old-space-size=6144
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Add swap space
run: |
# Resize existing swap from default 4 GB to 14 GB
sudo swapoff /swapfile || true
sudo rm -f /swapfile
sudo fallocate -l 14G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
free -h
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: '24'
cache: 'yarn'
cache-dependency-path: yarn.lock
- name: Install dependencies
run: yarn install --immutable
- name: Cache Docusaurus build
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
.docusaurus
node_modules/.cache
key: docusaurus-${{ runner.os }}-${{ hashFiles('yarn.lock', 'docusaurus.config.ts', 'versions.json') }}
restore-keys: |
docusaurus-${{ runner.os }}-
- name: Build
run: yarn build
- name: Upload Artifact
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: build
deploy:
name: Deploy
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
if: success() && github.ref == 'refs/heads/main'
needs: build
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
steps:
- name: Setup Pages
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0