Skip to content

cracrayol is building Kai Chronicles #53

cracrayol is building Kai Chronicles

cracrayol is building Kai Chronicles #53

name: Build and Deploy Kai Chronicles
env:
WEBPACK_ENV: ${{ vars.WEBPACK_ENV }}
run-name: ${{ github.actor }} is building Kai Chronicles
on: [push, workflow_dispatch]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: latest
- name: Build project
run: |
git config --global pack.threads "1"
npm install
npm run downloaddata --url=${{ vars.REPO_URL }}
npm run test --kaibook=1 --kaisect=tssf
npm run dist
- name: Summarize Tests
run: npx github-actions-ctrf ctrf/ctrf-report.json
- name: 'Tar files'
run: tar -cvf dist.tar -C dist .
- name: Archive dist folder
uses: actions/upload-artifact@v4
with:
name: dist
path: dist.tar
staging-deploy:
needs: build
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
artifact_name: dist
prod-deploy:
needs: [build, staging-deploy]
environment: Project Aon
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Download dist folder
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Extract archive
run: cd dist && mkdir extract && tar -xvf dist.tar -C extract
- name: Deploy files to Project Aon
uses: wlixcc/[email protected]
with:
ssh_private_key: ""
username: ${{ secrets.SFTP_USER }}
server: ${{ secrets.SFTP_HOST }}
password: ${{ secrets.SFTP_PASS }}
local_path: "./dist/extract/*"
remote_path: "/home/${{ secrets.SFTP_USER }}/kaichronicles.projectaon.org"