-
Notifications
You must be signed in to change notification settings - Fork 2
73 lines (62 loc) · 1.76 KB
/
deploy.yaml
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
name: Build and Deploy
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v11
- name: Setup Nix build cache
uses: DeterminateSystems/magic-nix-cache-action@v6
- name: Check Nix flake inputs
uses: DeterminateSystems/flake-checker-action@v7
- name: Build website for production
run: nix build .#for-production
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: result
path: result/
deploy-ocf:
runs-on: ubuntu-latest
needs: build
environment:
name: Production
url: https://berkeley.mt/
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: result
- name: Deploy to OCF
uses: burnett01/rsync-deployments@6.0.0
with:
switches: -avPh --delete --exclude=.htaccess
path: .
remote_path: ~/public_html/new
remote_host: tsunami.ocf.berkeley.edu
remote_user: bmt
remote_key: ${{ secrets.SSH_PRIVATE_KEY }}
deploy-cf-pages:
runs-on: ubuntu-latest
needs: build
environment:
name: Cloudflare Pages
url: https://berkeley-mt.pages.dev
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: result
- name: Deploy to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: 44d0498f26e72b3e24b3ba9d152ca879
projectName: berkeley-mt
directory: .