-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (63 loc) · 1.8 KB
/
deploy-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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Deploy to Cloudflare Pages
on:
workflow_dispatch:
# push:
# branches: [ "main" ]
jobs:
prepare:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Clone satro
run: git clone https://github.com/sakkyoi/satro
- name: Copy content to satro
run: |
# contents
cp -r ./announcement ./satro/src/content
cp -r ./footer ./satro/src/content
cp -r ./article ./satro/src/content
cp -r ./image ./satro/src/content
# public (blog thumbnail, favicon)
cp -r ./public ./satro
if [ -e ./_redirects ]; then
cp ./_redirects ./satro/public
fi
- uses: actions/upload-artifact@master
with:
name: satro
path: ./satro
build:
runs-on: ubuntu-latest
needs: prepare
steps:
- uses: actions/download-artifact@master
with:
name: satro
path: ./
- name: Build
run: |
npm install
npm run build
env:
SITE_URL: ${{ vars.SITE_URL || 'http://localhost' }}
SITE_TITLE: ${{ vars.SITE_TITLE }}
SITE_DESCRIPTION: ${{ vars.SITE_DESCRIPTION }}
SITE_LANG: ${{ vars.SITE_LANG }}
- uses: actions/upload-artifact@master
with:
name: dist
path: ./dist
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@master
with:
name: dist
path: ./
- name: Deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy ./ --project-name=${{ vars.PROJECT_NAME || vars.SITE_TITLE || 'satro' }}