-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (93 loc) · 3.47 KB
/
deploy.yml
File metadata and controls
105 lines (93 loc) · 3.47 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
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
name: Deploy Application
on:
# Trigger when called by the Release workflow after Semantic Release creates a new release
workflow_call:
inputs:
ref:
description: 'Git ref (branch, SHA or tag) to build from'
required: false
type: string
# Declare default permissions as read only.
permissions:
contents: read
actions: read
attestations: read
checks: read
deployments: read
discussions: read
issues: read
packages: read
pages: read
pull-requests: read
repository-projects: read
security-events: read
statuses: read
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
with:
egress-policy: block
allowed-endpoints: >
api.cloudflare.com:443
api.github.com:443
github.com:443
registry.npmjs.org:443
release-assets.githubusercontent.com:443
sparrow.cloudflare.com:443
- name: Checkout with specific ref
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
if: inputs.ref != ''
with:
fetch-depth: 0
ref: ${{ inputs.ref }}
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
if: inputs.ref == ''
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version-file: '.nvmrc'
- name: Install pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
with:
version: 10.30.3
- name: Get pnpm store directory
id: pnpm-store
shell: bash
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Cache pnpm store
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ${{ steps.pnpm-store.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}-node-${{ hashFiles('.nvmrc') }}
restore-keys: |
${{ runner.os }}-pnpm-
${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build application
env:
PUBLIC_SUPABASE_URL: ${{ vars.PUBLIC_SUPABASE_URL }}
PUBLIC_SUPABASE_ANON_KEY: ${{ vars.PUBLIC_SUPABASE_ANON_KEY }}
SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }}
GITHUB_APP_ID: ${{ vars.WORKFLOW_METRICS_APP_ID }}
GITHUB_APP_PRIVATE_KEY: ${{ secrets.WORKFLOW_METRICS_APP_PRIVATE_KEY }}
GITHUB_APP_SLUG: ${{ vars.WORKFLOW_METRICS_APP_SLUG }}
run: pnpm run build
- name: Deploy application
env:
PUBLIC_SUPABASE_URL: ${{ vars.PUBLIC_SUPABASE_URL }}
PUBLIC_SUPABASE_ANON_KEY: ${{ vars.PUBLIC_SUPABASE_ANON_KEY }}
SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }}
GITHUB_APP_ID: ${{ vars.WORKFLOW_METRICS_APP_ID }}
GITHUB_APP_PRIVATE_KEY: ${{ secrets.GITHUB_APP_PRIVATE_KEY }}
GITHUB_APP_SLUG: ${{ vars.WORKFLOW_METRICS_APP_SLUG }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
run: pnpm run deploy