-
Notifications
You must be signed in to change notification settings - Fork 3
43 lines (36 loc) · 997 Bytes
/
publish.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
name: publish
on:
workflow_dispatch:
push:
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
name: Publish to Cloudflare Pages
steps:
- name: Checkout
uses: actions/checkout@v3
- name: get Repository name
run: echo "PROJECT_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Build source code.
run: npm run build
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@1
with:
accountId: 620ff29bbd515d2848f5306578bd1d1d
apiToken: ${{ secrets.CLOUDFLARE_PAGES_TOKEN }}
projectName: ${{ env.PROJECT_NAME }}
directory: build
gitHubToken: ${{ secrets.GITHUB_TOKEN }}