-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (79 loc) · 2.62 KB
/
deploy.yaml
File metadata and controls
89 lines (79 loc) · 2.62 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
name: Deploy Blog to Cloudflare Pages
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: blog-deploy-${{ github.ref }}
cancel-in-progress: true
jobs:
deploy:
name: Deploy to Cloudflare Pages
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm run build
env:
PUBLIC_GISCUS_REPO: unoplat/unoplat-code-confluence
PUBLIC_GISCUS_REPO_ID: R_kgDOLpX7Fw
PUBLIC_GISCUS_CATEGORY: Announcements
PUBLIC_GISCUS_CATEGORY_ID: DIC_kwDOLpX7F84Ce2Lw
PUBLIC_GISCUS_MAPPING: pathname
PUBLIC_GISCUS_STRICT: "0"
PUBLIC_GISCUS_REACTIONS: "1"
PUBLIC_GISCUS_EMIT_METADATA: "0"
PUBLIC_GISCUS_INPUT_POSITION: bottom
PUBLIC_GISCUS_THEME: preferred_color_scheme
PUBLIC_GISCUS_LANG: en
PUBLIC_GISCUS_LOADING: lazy
- name: Deploy to Cloudflare Pages
id: deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
- name: Output Deployment URLs
env:
DEPLOYMENT_URL: ${{ steps.deploy.outputs.deployment-url }}
ALIAS_URL: ${{ steps.deploy.outputs.pages-deployment-alias-url }}
run: |
echo "Deployment URL: $DEPLOYMENT_URL"
echo "Branch Preview URL: $ALIAS_URL"
- name: Comment on PR
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
env:
DEPLOYMENT_URL: ${{ steps.deploy.outputs.deployment-url }}
ALIAS_URL: ${{ steps.deploy.outputs.pages-deployment-alias-url }}
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `🚀 **Preview Deployment Ready!**\n\n**Preview URL**: ${process.env.ALIAS_URL || process.env.DEPLOYMENT_URL}\n\n---\n*Deployed via Cloudflare Pages*`
})