-
Notifications
You must be signed in to change notification settings - Fork 16
67 lines (56 loc) · 1.69 KB
/
Copy pathdeploy.yml
File metadata and controls
67 lines (56 loc) · 1.69 KB
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
67
# Deploy to Cloudflare Pages
name: Deploy
concurrency:
group: ${{ github.ref }}-deploy
cancel-in-progress: true
on:
push:
branches: [master]
env:
PRINCE_VER: 15.1
jobs:
deploy:
runs-on: ubuntu-latest
if: github.repository_owner == 'FOME-Tech'
permissions:
contents: read
deployments: write
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: ".nvmrc"
cache: "npm"
- name: Install PrinceXML
run: |
curl https://www.princexml.com/download/prince-${{ env.PRINCE_VER }}-linux-generic-x86_64.tar.gz -O
tar zxf prince-${{ env.PRINCE_VER }}-linux-generic-x86_64.tar.gz
cd prince-${{ env.PRINCE_VER }}-linux-generic-x86_64
yes "" | sudo ./install.sh
- name: Install Node.js dependencies
run: npm ci
- name: Build
run: npm run build
# TODO: fix PDF file size constraint issue
# https://github.com/FOME-Tech/wiki/issues/382
# - name: Generate PDF
# run: |
# npm run serve &
# sleep 5
# npm run pdf
#
# - name: Check for generated PDF
# run: ls -lah static/pdf/wiki.fome.pdf
#
# - name: Rebuild with PDF
# run: npm run build
#
# - name: Check for bundled PDF
# run: ls -lah build/pdf/wiki.fome.pdf
- name: Deploy to Cloudflare Pages
uses: cloudflare/wrangler-action@v4
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy build/ --project-name=wiki --branch master
gitHubToken: ${{ secrets.GITHUB_TOKEN }} # GitHub Deployments