generated from amattu2/project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (47 loc) · 1.49 KB
/
cloudflare-pages.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
47
48
49
50
51
52
53
54
55
name: Cloudflare Pages
concurrency:
group: "cloudflare-pages"
cancel-in-progress: false
on:
workflow_dispatch:
push:
tags:
- "v*"
paths:
- "src/**"
- "public/**"
jobs:
publish:
name: Publish to Cloudflare Pages
if: ${{ github.repository_owner == 'amattu2' }}
runs-on: ubuntu-latest
environment: better-vinwiki (Production)
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Dependencies
run: npm ci
- name: Test (Jest)
run: npm run test:ci
- name: Lint (EsLint)
run: npm run lint:ci
- name: Build
env:
REACT_APP_NAME: ${{ vars.REACT_APP_NAME }}
REACT_APP_URL: ${{ vars.REACT_APP_URL }}
REACT_APP_DESCRIPTION: ${{ vars.REACT_APP_DESCRIPTION }}
REACT_APP_SLOGAN: ${{ vars.REACT_APP_SLOGAN }}
REACT_APP_API_URL: ${{ vars.REACT_APP_API_URL }}
REACT_APP_MEDIA_API_URL: ${{ vars.REACT_APP_MEDIA_API_URL }}
REACT_APP_MEDIA_CDN_URL: ${{ vars.REACT_APP_MEDIA_CDN_URL }}
REACT_APP_API_CLIENT: ${{ vars.REACT_APP_API_CLIENT }}
run: npm run build
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: better-vinwiki
directory: ./build
branch: main