-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (58 loc) · 2.01 KB
/
Copy pathdeploy.yml
File metadata and controls
70 lines (58 loc) · 2.01 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, attest, and deploy
on:
push:
branches: [main]
workflow_dispatch:
concurrency:
group: deploy-${{ github.ref }}
cancel-in-progress: false
permissions:
contents: read
id-token: write # required for Sigstore OIDC signing
attestations: write # required to publish the attestation
jobs:
deploy:
runs-on: ubuntu-latest
environment: production
env:
NEXT_PUBLIC_SITE_URL: ${{ vars.NEXT_PUBLIC_SITE_URL }}
NEXT_PUBLIC_DATABUDDY_CLIENT_ID: ${{ vars.NEXT_PUBLIC_DATABUDDY_CLIENT_ID }}
NEXT_PUBLIC_BUILD_SHA: ${{ github.sha }}
steps:
- uses: actions/checkout@v6
- name: Enable Corepack
run: corepack enable
- uses: actions/setup-node@v6
with:
node-version: 22
cache: yarn
- name: Install dependencies
run: yarn install --immutable
- name: Build (OpenNext for Cloudflare)
run: yarn run cf:build
- name: Package artifact for attestation
id: pack
run: |
mkdir -p dist
tar --sort=name --owner=0 --group=0 --numeric-owner \
--mtime='UTC 2020-01-01' \
-czf dist/ghalyzer-${{ github.sha }}.tar.gz \
-C .open-next .
echo "artifact=dist/ghalyzer-${{ github.sha }}.tar.gz" >> "$GITHUB_OUTPUT"
- name: Generate SLSA build provenance attestation
id: attest
uses: actions/attest-build-provenance@v2
with:
subject-path: ${{ steps.pack.outputs.artifact }}
- name: Upload artifact + attestation to release assets
uses: actions/upload-artifact@v4
with:
name: ghalyzer-${{ github.sha }}
path: |
${{ steps.pack.outputs.artifact }}
${{ steps.attest.outputs.bundle-path }}
- name: Deploy to Cloudflare (Workers/Pages via OpenNext)
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run: yarn run cf:deploy