upd CI to address GHSA-cxww-7g56-2vh6 #87
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: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
# from https://davidegerosa.com/githubforlatex/ | |
jobs: | |
paper: | |
runs-on: ubuntu-latest | |
env: | |
# Edit here with the names of your latex file and directory (can use ".") | |
DIR: src | |
FILE: main | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Compile LaTeX document | |
uses: xu-cheng/latex-action@v2 | |
with: | |
root_file: ${{ env.DIR }}/${{ env.FILE }}.tex | |
work_in_root_file_dir: true | |
- name: move | |
run: mkdir -p github_artifacts && mv ${{ env.DIR }}/${{ env.FILE }}.pdf ./github_artifacts/ | |
- name: Upload pdf as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ env.FILE }}.pdf | |
path: ./github_artifacts | |
deploy: | |
# Edit here if compiling multiple papers | |
needs: [paper] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v4 | |
with: | |
path: github_artifacts | |
- name: move | |
run: mkdir -p github_deploy && mv github_artifacts/*/* github_deploy | |
- name: deploy on orphan branch | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./github_deploy | |
publish_branch: build | |
force_orphan: true |