-
Notifications
You must be signed in to change notification settings - Fork 39
139 lines (129 loc) · 5.15 KB
/
deploy-ceremony.yml
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Deploy Ceremony
on:
push:
branches:
- main
- release/ceremony
paths:
- 'ceremony/**'
pull_request:
paths:
- 'ceremony/**'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
env:
NODE_OPTIONS: '--no-warnings'
ACTIONS_RUNNER_DEBUG: true
ASTRO_TELEMETRY_DISABLED: true
jobs:
deploy-preview:
runs-on: ['ubuntu-latest']
permissions:
contents: read
pull-requests: write
env:
npm_config_yes: true
environment: 'ceremony-preview'
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: nixbuild/nix-quick-install-action@v28
with:
nix_conf: |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g= union.cachix.org-1:TV9o8jexzNVbM1VNBOq9fu8NK+hL6ZhOyOh0quATy+M=
trusted-substituters = https://cache.nixos.org https://cache.garnix.io https://union.cachix.org
- name: Fetch from Cache
run: |
nix build .#ceremony
- name: '[preview] 🔶 Publish to Cloudflare Pages'
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_WORKERS_API_TOKEN }}
run: npx --yes wrangler@latest pages --project-name="ceremony" deploy result >> /tmp/ceremony_deploy.txt
- name: Set Deploy Output
run: |
{
echo 'DEPLOY_OUTPUT<<EOF'
tail -n 2 /tmp/ceremony_deploy.txt
echo 'EOF'
} >> $GITHUB_ENV
- name: Comment Site Deploy Results
uses: thollander/actions-comment-pull-request@v2
with:
message: |
# Ceremony 🤌
${{ env.DEPLOY_OUTPUT }}
**${{ env.LAST_UPDATED_AT }}**
comment_tag: deploy-ceremony-preview-result
deploy-manual:
runs-on: ['ubuntu-latest']
env:
npm_config_yes: true
if: github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: nixbuild/nix-quick-install-action@v28
with:
nix_conf: |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g= union.cachix.org-1:TV9o8jexzNVbM1VNBOq9fu8NK+hL6ZhOyOh0quATy+M=
trusted-substituters = https://cache.nixos.org https://cache.garnix.io https://union.cachix.org
- name: Fetch from Cache
run: |
nix build .#ceremony
- name: '[workflow-dispatch] 🔶 Publish to Cloudflare Pages'
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_WORKERS_API_TOKEN }}
run: npx --yes wrangler@latest pages --project-name="ceremony" deploy result
deploy-staging:
runs-on: ['ubuntu-latest']
env:
npm_config_yes: true
environment: 'ceremony-staging'
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: nixbuild/nix-quick-install-action@v28
with:
nix_conf: |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g= union.cachix.org-1:TV9o8jexzNVbM1VNBOq9fu8NK+hL6ZhOyOh0quATy+M=
trusted-substituters = https://cache.nixos.org https://cache.garnix.io https://union.cachix.org
- name: Fetch from Cache
run: |
nix build .#ceremony
- name: '[staging] 🔶 Publish to Cloudflare Pages'
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_WORKERS_API_TOKEN }}
run: npx --yes wrangler@latest pages --project-name="ceremony" --branch="staging" deploy result
deploy-production:
runs-on: ['ubuntu-latest']
env:
npm_config_yes: true
environment: 'ceremony-production'
if: github.event_name == 'push' && github.ref == 'refs/heads/release/ceremony'
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: nixbuild/nix-quick-install-action@v28
with:
nix_conf: |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g= union.cachix.org-1:TV9o8jexzNVbM1VNBOq9fu8NK+hL6ZhOyOh0quATy+M=
trusted-substituters = https://cache.nixos.org https://cache.garnix.io https://union.cachix.org
- name: Fetch from Cache
run: |
nix build .#ceremony
- name: '[production] 🔶 Publish to Cloudflare Pages'
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_WORKERS_API_TOKEN }}
run: npx --yes wrangler@latest pages --project-name="ceremony" --branch="main" deploy result