fixing paths and flow #74
This file contains hidden or 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: Quarto CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| #Guardrail: blocks PRs that touch _freeze/ or _site/ directories | |
| - name: Guardrail - disallow changes to _freeze/ and _site/ in PRs | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| CHANGED=$(git diff --name-only origin/main...HEAD | grep -E '^(_freeze/|_site/)' || true) | |
| if [ -n "$CHANGED" ]; then | |
| echo "Error: Changes to _freeze/ or _site/ directories are not allowed in this PR:" | |
| echo "$CHANGED" | |
| exit 1 | |
| fi | |
| - uses: quarto-dev/quarto-actions/setup@v2 | |
| - uses: r-lib/actions/setup-r@v2 | |
| with: | |
| use-public-rspm: true | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libglpk-dev libxml2-dev libcurl4-openssl-dev libssl-dev | |
| - name: Restore R packages via renv (if present) | |
| run: | | |
| if [ -f renv.lock ]; then | |
| R -q -e 'if (!requireNamespace("renv", quietly=TRUE)) install.packages("renv")' | |
| R -q -e 'renv::restore()' | |
| fi | |
| - name: Render Quarto Website | |
| run: quarto render --profile ci | |
| - name: Upload to Github Pages | |
| if: github.event_name == 'push' | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./_site | |
| publish_branch: gh-pages |