Skip to content

Commit 03ce081

Browse files
committed
Upload website to Cloudflare
1 parent d7a30da commit 03ce081

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
concurrency:
9+
group: deploy-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
deploy:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Install Nix (with Garnix cache)
23+
uses: DeterminateSystems/nix-installer-action@v19
24+
with:
25+
extra-conf: |
26+
extra-substituters = https://cache.garnix.io
27+
extra-trusted-public-keys = cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=
28+
29+
- name: Wait for Garnix
30+
uses: lewagon/wait-on-check-action@v1.4.0
31+
with:
32+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
33+
check-name: "All garnix checks"
34+
repo-token: ${{ secrets.GITHUB_TOKEN }}
35+
wait-interval: 3
36+
verbose: false
37+
38+
- name: Build and deploy to Cloudflare Pages
39+
env:
40+
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
41+
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
42+
run: |
43+
set -eu
44+
45+
nix build .#website
46+
47+
npx --yes wrangler@latest pages deploy ./result \
48+
--project-name grace \
49+
--branch "${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}"

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
&& (builtins.elem (baseNameOf path) [
5353
"dist"
5454
"dist-newstyle"
55+
".github"
5556
"examples"
5657
"prelude"
5758
"website"

0 commit comments

Comments
 (0)