forked from dreamhunter2333/cloudflare_temp_email
-
Notifications
You must be signed in to change notification settings - Fork 71
Expand file tree
/
Copy pathfrontend_pagefunction_deploy.yaml
More file actions
60 lines (54 loc) · 1.5 KB
/
frontend_pagefunction_deploy.yaml
File metadata and controls
60 lines (54 loc) · 1.5 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
name: Deploy Frontend with page function
on:
workflow_run:
workflows: [Upstream Sync]
types: [completed]
push:
tags:
- "*"
workflow_dispatch:
jobs:
check:
runs-on: ubuntu-latest
outputs:
has_config: ${{ steps.check.outputs.has_config }}
steps:
- name: Check PAGE_TOML
id: check
run: |
if [ -n "$PAGE_TOML" ]; then
echo "has_config=true" >> $GITHUB_OUTPUT
else
echo "has_config=false" >> $GITHUB_OUTPUT
fi
env:
PAGE_TOML: ${{ secrets.PAGE_TOML }}
deploy:
needs: check
if: ${{ needs.check.outputs.has_config == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: 24
- uses: pnpm/action-setup@v5
name: Install pnpm
with:
version: 10
run_install: false
- name: Deploy Frontend for ${{ github.ref_name }}
run: |
cd frontend/
pnpm install --no-frozen-lockfile
pnpm build:pages
cd ../pages/
echo '${{ secrets.PAGE_TOML }}' > wrangler.toml
pnpm install --no-frozen-lockfile
pnpm run deploy
echo "Deploying production for ${{ github.ref_name }}"
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}