Skip to content

Merge pull request #9 from kiritowu/fix/profile-json-as-yaml #39

Merge pull request #9 from kiritowu/fix/profile-json-as-yaml

Merge pull request #9 from kiritowu/fix/profile-json-as-yaml #39

Workflow file for this run

name: Deploy to GitHub Pages
on:
push:
branches:
- 'main'
- feat/latex-resume-export
jobs:
compile-latex:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm install
- name: Compile latex
run: |
node scripts/1.compile-latex-template.js
- name: Cache LaTeX files
uses: actions/cache@v4
with:
path: ./tex
key: tex
export-latex-to-pdf:
needs: compile-latex
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Docker
uses: docker/setup-buildx-action@v3
- name: Build Docker image
run: docker build -t texlive-extended .
working-directory: ./tex
- name: Cache LaTeX files
uses: actions/cache@v4
with:
path: ./tex
key: tex
- name: Run Docker container
run: |
docker run --rm \
--volume `pwd`/tex:/work/src:ro \
--volume `pwd`/tex/out:/work/out \
-e TEXLIVE_REPOSITORY='https://sg.mirrors.cicku.me/ctan/systems/texlive/tlnet' \
texlive-extended:latest \
work lualatex WongZhaoWu-resume.tex
- name: Copy PDF to static
run: |
cp tex/out/WongZhaoWu-resume.pdf \
./static/WongZhaoWu-resume.pdf
- name: Cache Static files
uses: actions/cache@v4
with:
path: ./static
key: static
build-site:
needs: export-latex-to-pdf
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# If you're using pnpm, add this step then change the commands and cache key below to use `pnpm`
# - name: Install pnpm
# uses: pnpm/action-setup@v2
# with:
# version: 8
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- name: Install dependencies
run: npm install
- run: ls -la node_modules
- name: Cache Static files
uses: actions/cache@v4
with:
path: ./static
key: static
- name: build
env:
BASE_PATH: '/${{ github.event.repository.name }}'
run: |
npm run build
- name: Upload Artifacts
uses: actions/upload-pages-artifact@v2
with:
# this should match the `pages` option in your adapter-static options
path: 'build/'
deploy:
needs: build-site
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy
id: deployment
uses: actions/deploy-pages@v2