Skip to content

week3 updated by Sina #3

week3 updated by Sina

week3 updated by Sina #3

name: Build and Deploy
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build-slides:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup LaTeX
uses: xu-cheng/latex-action@v3
with:
working_directory: slides
root_file: week2_slides.tex
- name: Upload PDF artifact
uses: actions/upload-artifact@v4
with:
name: slides-pdf
path: slides/week2_slides.pdf
deploy:
runs-on: ubuntu-latest
needs: build-slides
if: github.ref == 'refs/heads/main'
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download slides PDF
uses: actions/download-artifact@v4
with:
name: slides-pdf
path: docs/slides
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4