-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnetlify.yml
More file actions
48 lines (44 loc) · 1.51 KB
/
Copy pathnetlify.yml
File metadata and controls
48 lines (44 loc) · 1.51 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
name: Netlify preview parity
on:
pull_request:
permissions:
contents: read
concurrency:
group: netlify-preview-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
preview:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
- run: npm ci
- name: Deploy the preview
id: deploy
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
run: |
npx netlify-cli@27.0.1 deploy \
--build \
--context deploy-preview \
--json \
--auth "$NETLIFY_AUTH_TOKEN" \
--site "$NETLIFY_SITE_ID" > "$RUNNER_TEMP/netlify-deploy.json"
node --input-type=module -e '
import { readFileSync, appendFileSync } from "node:fs";
const result = JSON.parse(readFileSync(process.env.RUNNER_TEMP + "/netlify-deploy.json", "utf8"));
const url = new URL(result.deploy_url);
if (url.protocol !== "https:") throw new Error("Netlify returned a non-HTTPS deployment URL");
appendFileSync(process.env.GITHUB_OUTPUT, `url=${url.href}\n`);
'
- uses: loke-dev/deployproof@v0.3.0
with:
preview: ${{ steps.deploy.outputs.url }}
production: ${{ vars.PRODUCTION_URL }}
config: deployproof.config.json
strict: true