mirror of https://github.com/FOME-Tech/wiki.git
Switch to CF auto-deployments for preview branches (#116)
This commit is contained in:
parent
b680dc8259
commit
f8c4dfba69
|
@ -0,0 +1,23 @@
|
||||||
|
# Validate build to provide early feedback on pull requests
|
||||||
|
name: Build
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.ref }}-build
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
validate:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version-file: '.nvmrc'
|
||||||
|
cache: 'npm'
|
||||||
|
- run: npm ci
|
||||||
|
- run: npm run build
|
|
@ -1,3 +1,4 @@
|
||||||
|
# Deploy to Cloudflare Pages
|
||||||
name: Deploy
|
name: Deploy
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
# Validate typescript files, links and markdown
|
||||||
|
#
|
||||||
|
# Configuration files:
|
||||||
|
# - typescript: tsconfig.json
|
||||||
|
# - links: scripts/linkValidator.js
|
||||||
|
# - makrdown: .markdownlint.jsonc
|
||||||
name: Lint
|
name: Lint
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
|
|
|
@ -1,63 +0,0 @@
|
||||||
name: Preview
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.ref }}-preview
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches: [ master ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository_owner == 'FOME-Tech' && github.actor != 'dependabot[bot]'
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
deployments: write
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version-file: '.nvmrc'
|
|
||||||
cache: 'npm'
|
|
||||||
|
|
||||||
- name: Install PrinceXML
|
|
||||||
run: |
|
|
||||||
curl https://www.princexml.com/download/prince-15.1-linux-generic-x86_64.tar.gz -O
|
|
||||||
tar zxf prince-15.1-linux-generic-x86_64.tar.gz
|
|
||||||
cd prince-15.1-linux-generic-x86_64
|
|
||||||
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
|
|
||||||
with:
|
|
||||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
||||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
||||||
projectName: wiki
|
|
||||||
directory: build
|
|
||||||
gitHubToken: ${{ secrets.GITHUB_TOKEN }} # GitHub Deployments
|
|
||||||
wranglerVersion: '3'
|
|
Loading…
Reference in New Issue