Skip to content

Commit 207b189

Browse files
committed
ci: hope and pray
1 parent 5d1dfe5 commit 207b189

1 file changed

Lines changed: 58 additions & 10 deletions

File tree

Lines changed: 58 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,86 @@
1-
name: Build and deploy
2-
on: [push]
1+
name: Deploy GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- release
7+
- beta
8+
- develop
9+
310
permissions:
411
contents: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: true
16+
517
jobs:
618
build:
719
runs-on: ubuntu-latest
820
steps:
9-
- name: Checkout
21+
- name: Create output directory
22+
run: mkdir -p site/beta site/develop
23+
24+
# --- RELEASE (root) ---
25+
- name: Checkout release
26+
uses: actions/checkout@v4
27+
with:
28+
ref: release
29+
path: release
30+
31+
- name: Build release
32+
run: |
33+
cd release
34+
npm ci
35+
npm run build
36+
cp -r public/* ../site
37+
38+
# --- BETA ---
39+
- name: Checkout beta
1040
uses: actions/checkout@v4
41+
with:
42+
ref: beta
43+
path: beta
1144

12-
- name: Install and build
45+
- name: Build beta
1346
run: |
47+
cd beta
1448
npm ci
1549
npm run build
50+
cp -r public/* ../site/beta/
51+
52+
# --- DEVELOP ---
53+
- name: Checkout develop
54+
uses: actions/checkout@v4
55+
with:
56+
ref: develop
57+
path: develop
1658

17-
- name: Upload artifact
59+
- name: Build develop
60+
run: |
61+
cd develop
62+
npm ci
63+
npm run build
64+
cp -r public/* ../site/develop/
65+
66+
- name: Upload Pages artifact
1867
uses: actions/upload-pages-artifact@v3
1968
with:
20-
name: github-pages
21-
path: ./public
69+
path: site
70+
2271
deploy:
2372
needs: build
24-
if: success() && github.ref == 'refs/heads/release'
2573
permissions:
2674
pages: write # to deploy to Pages
2775
id-token: write # to verify the deployment originates from an appropriate source
2876
environment:
2977
name: github-pages
3078
url: ${{ steps.deployment.outputs.page_url }}
31-
79+
3280
runs-on: ubuntu-latest
3381
steps:
3482
- name: Deploy to GitHub Pages
3583
id: deployment
3684
uses: actions/deploy-pages@v4
3785
with:
38-
artifact_name: github-pages
86+
artifact_name: github-pages

0 commit comments

Comments
 (0)