-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (45 loc) 路 1.4 KB
/
Copy pathdeploy.yml
File metadata and controls
48 lines (45 loc) 路 1.4 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: Deploy
on:
pull_request:
push:
branches: [master]
concurrency:
group: deploy-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Production alias tracks master. PR pushes are preview-only.
# No custom domain / apex cutover until explicitly approved.
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: npm
- run: npm ci
- run: npm run check
- run: npm run build
- name: Deploy to Cloudflare Pages
id: deploy
uses: cloudflare/wrangler-action@v4
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy dist --project-name=kylecesmat
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
- name: Write deployment URLs
env:
DEPLOYMENT_URL: ${{ steps.deploy.outputs.deployment-url }}
DEPLOYMENT_ALIAS_URL: ${{ steps.deploy.outputs.pages-deployment-alias-url }}
run: |
{
echo "## Cloudflare Pages"
echo "- Deployment URL: ${DEPLOYMENT_URL}"
echo "- Alias URL: ${DEPLOYMENT_ALIAS_URL}"
} >> "$GITHUB_STEP_SUMMARY"