-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (43 loc) · 1.16 KB
/
cloudflare.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: Cloudflare
on:
push:
branches:
- main
jobs:
build:
if: "!contains(github.event.head_commit.message, '[skip-ci]')"
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: github/codeql-action/init@v2
- uses: actions/setup-node@v3
with:
node-version: "20.x"
cache: "npm"
- run: npm ci
- run: npm run build --ignore-scripts
env:
SHOPIFY_API_KEY: ${{ env.SHOPIFY_API_KEY }}
- run: npm test
- uses: github/codeql-action/analyze@v2
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist
deploy:
if: "!contains(github.event.head_commit.message, '[skip-ci]')"
name: Deploy
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: dist
- uses: cloudflare/pages-action@v1
with:
accountId: ${{ env.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_TOKEN }}
directory: dist
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
projectName: ${{ env.CLOUDFLARE_PROJECT }}