Update main.yml #28
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 and Deploy LaTeX document | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Compile LaTeX document | |
uses: xu-cheng/latex-action@v3 | |
with: | |
root_file: main.tex | |
- name: Upload PDF as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: main-pdf | |
path: main.pdf | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
permissions: | |
pages: write | |
id-token: write | |
steps: | |
- name: Checkout gh-pages branch | |
uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
token: ${{ secrets.GH_PAT }} | |
- name: Download PDF artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: main-pdf | |
path: . | |
- name: Deploy to GitHub Pages | |
uses: actions/deploy-pages@v1 | |
with: | |
token: ${{ secrets.GH_PAT }} | |
branch: gh-pages | |
folder: . |