-
Notifications
You must be signed in to change notification settings - Fork 3
46 lines (40 loc) · 1.04 KB
/
deploy.yml
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
name: Deploy
on:
workflow_call:
inputs:
project_name:
type: string
required: true
default: 'Cloudflare Pages Project Name'
secrets:
CLOUDFLARE_ACCOUNT_ID:
required: true
CLOUDFLARE_API_TOKEN:
required: true
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
permissions:
contents: write
deployments: write
steps:
- name: Checkout Source
uses: actions/checkout@v4
- name: Setup NodeJS
uses: actions/setup-node@v4
- name: Install Dependencies
run: npm ci
- name: Build for Production
env:
NODE_ENV: production
run: npm run build
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
directory: ./build
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
projectName: ${{ inputs.project_name }}
branch: 'main'