name: Compile Exercise 1 on: workflow_dispatch: push: branches: [main] paths: - "exercise-1/**" - ".github/workflows/compile-exercise-1.yml" # Compile pull requests to catch errors, but only deploy from main pull_request: paths: - "exercise-1/**" - ".github/workflows/compile-exercise-1.yml" # Required for actions/deploy-pages@v4 to obtain an OIDC token permissions: contents: read pages: write id-token: write concurrency: group: "pages-${{ github.ref }}" cancel-in-progress: true jobs: compile-paper: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v7 - name: Run compile run: docker run --rm --mount type=bind,src="$PWD",dst=/work --workdir /work ghcr.io/typst/typst:latest compile exercise-1/exercise-1.typ exercise-1.pdf - name: Upload Artifact uses: actions/upload-artifact@v7 with: path: exercise-1.pdf - name: Prepare Pages artifact folder run: | mkdir -p dist cp exercise-1.pdf dist/exercise-1.pdf # optional: make it easier to browse by adding a simple index page cat > dist/index.html <<'EOF' Exercise 1 exercise-1.pdf EOF - name: Upload static files as artifact id: deployment uses: actions/upload-pages-artifact@v5 with: path: dist deploy-pages: if: github.ref == 'refs/heads/main' environment: name: exercise-1 runs-on: ubuntu-latest needs: compile-paper steps: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v5