2023-07-02 00:24:56 -07:00
|
|
|
# Deploy to Cloudflare Pages
|
2023-06-19 03:17:02 -07:00
|
|
|
name: Deploy
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.ref }}-deploy
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2023-09-14 13:19:57 -07:00
|
|
|
branches: [master]
|
2023-06-19 03:17:02 -07:00
|
|
|
|
2023-08-30 05:08:23 -07:00
|
|
|
env:
|
|
|
|
PRINCE_VER: 15.1
|
|
|
|
|
2023-06-19 03:17:02 -07:00
|
|
|
jobs:
|
|
|
|
deploy:
|
|
|
|
runs-on: ubuntu-latest
|
2023-07-01 11:46:51 -07:00
|
|
|
if: github.repository_owner == 'FOME-Tech'
|
2023-06-19 03:17:02 -07:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
deployments: write
|
|
|
|
|
|
|
|
steps:
|
2023-09-06 07:20:26 -07:00
|
|
|
- uses: actions/checkout@v4
|
2023-06-19 03:17:02 -07:00
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
2023-09-14 13:19:57 -07:00
|
|
|
node-version-file: ".nvmrc"
|
|
|
|
cache: "npm"
|
2023-06-22 02:45:41 -07:00
|
|
|
|
|
|
|
- name: Install PrinceXML
|
|
|
|
run: |
|
2023-08-30 05:08:23 -07:00
|
|
|
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
|
2023-06-22 02:45:41 -07:00
|
|
|
yes "" | sudo ./install.sh
|
|
|
|
|
|
|
|
- name: Install Node.js dependencies
|
|
|
|
run: npm ci
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: npm run build
|
|
|
|
|
|
|
|
- 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/pages-action@v1
|
2023-06-19 03:17:02 -07:00
|
|
|
with:
|
|
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
|
|
projectName: wiki
|
|
|
|
directory: build
|
|
|
|
gitHubToken: ${{ secrets.GITHUB_TOKEN }} # GitHub Deployments
|
|
|
|
branch: master
|
2023-09-14 13:19:57 -07:00
|
|
|
wranglerVersion: "3"
|