Webapp build with Svelte #29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build PDFs and Deploy | |
on: | |
push: | |
branches: [ "trunk" ] | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow one concurrent deployment | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: mkdir -p ~/image-cache | |
- name: Cache Image | |
id: image-cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/image-cache | |
key: ${{ runner.os }}-image-cache | |
- name: Build docker image | |
if: steps.image-cache.outputs.cache-hit != 'true' | |
run: | | |
docker build . --file Dockerfile --tag latex | |
docker save -o ~/image-cache/latex.tar latex | |
- name: Load docker image from cache | |
if: steps.image-cache.outputs.cache-hit == 'true' | |
run: docker load -i ~/image-cache/latex.tar | |
- name: Build pdf using docker image | |
run: | | |
docker run --rm -v "$(pwd):/home/porter/app" --name maths --user root --hostname latex latex sh ./deploy.sh -j -p | |
- name: Build webapp | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20.8.0 | |
run: | | |
npm install -g pnpm | |
pnpm i | |
pnpm build | |
- name: Upload site artifact | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: "dist${{ steps.pages.outputs.base_path }}" | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 | |