-
Notifications
You must be signed in to change notification settings - Fork 5
70 lines (61 loc) · 1.59 KB
/
Copy pathmain.yml
File metadata and controls
70 lines (61 loc) · 1.59 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
name: Build and deploy main branch
on:
schedule:
- cron: '47 04 * * 1' # At 04:47 on Monday.
push:
branches: [ "main" ]
# uncomment the following two lines while developing the CI
# pull_request:
# branches: [ "main" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: cachix/install-nix-action@v26
- uses: cachix/cachix-action@v14
with:
name: devenv
- name: Install devenv.sh
run: nix profile install nixpkgs#devenv
- name: Test
run: |
devenv test
- name: Build
run: |
devenv shell npm run build
- name: Upload static HTML artifact
uses: actions/upload-artifact@v4
with:
name: static-html
path: dist/
deploy-main-to-branch:
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event_name == 'schedule'
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download static HTML artifact
uses: actions/download-artifact@v4
with:
name: static-html
path: dist
- name: Deploy to branch
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dist
branch: dist
single-commit: true
deploy-main-to-prod:
needs: deploy-main-to-branch
runs-on: ubuntu-latest
steps:
- name: Call PROD_DEPLOY_WEBHOOK
run: |
curl -X POST ${{ secrets.PROD_DEPLOY_WEBHOOK }}