Skip to content

Add infectious disease publications to inspirations and grants table to research projects #1129

Add infectious disease publications to inspirations and grants table to research projects

Add infectious disease publications to inspirations and grants table to research projects #1129

name: Render and Publish
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
# Required permissions for GitHub Pages deployment
permissions:
contents: read
pages: write
id-token: write
# Prevent concurrent deployments
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Build job - renders Quarto project
build:
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Render Quarto Project
uses: quarto-dev/quarto-actions/render@v2
# Upload PR preview artifact
- name: Upload PR preview artifact
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: pr-preview-${{ github.event.pull_request.number }}
path: _site
retention-days: 7
compression-level: 6
# Configure and upload for GitHub Pages (main branch only)
- name: Setup Pages
if: github.ref == 'refs/heads/main'
uses: actions/configure-pages@v5
- name: Upload Pages artifact
if: github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v3
with:
path: _site
# Create comprehensive build summary
- name: Create build summary
if: always()
run: |
echo "## πŸ“Š Quarto Build Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Property | Value |" >> $GITHUB_STEP_SUMMARY
echo "|----------|-------|" >> $GITHUB_STEP_SUMMARY
echo "| Event | ${{ github.event_name }} |" >> $GITHUB_STEP_SUMMARY
echo "| Branch | ${{ github.ref_name }} |" >> $GITHUB_STEP_SUMMARY
echo "| Commit | \`${{ github.sha }}\` |" >> $GITHUB_STEP_SUMMARY
echo "| Workflow | [${{ github.workflow }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ "${{ github.event_name }}" = "pull_request" ]; then
echo "### βœ… PR Preview" >> $GITHUB_STEP_SUMMARY
echo "Site rendered successfully for PR #${{ github.event.pull_request.number }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Download the artifact from the [Actions tab](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) to preview the changes." >> $GITHUB_STEP_SUMMARY
elif [ "${{ github.ref }}" = "refs/heads/main" ]; then
echo "### βœ… Production Build" >> $GITHUB_STEP_SUMMARY
echo "Site rendered successfully and ready for deployment to GitHub Pages." >> $GITHUB_STEP_SUMMARY
else
echo "### βœ… Build Complete" >> $GITHUB_STEP_SUMMARY
echo "Site rendered successfully." >> $GITHUB_STEP_SUMMARY
fi
# Deploy job - deploys to GitHub Pages (main branch only)
deploy:
if: github.ref == 'refs/heads/main'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
timeout-minutes: 10
needs: build
permissions:
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- name: Create deployment summary
if: success()
run: |
echo "## πŸš€ Deployment Complete" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "The site has been successfully deployed to GitHub Pages." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "πŸ”— **Site URL:** ${{ steps.deployment.outputs.page_url }}" >> $GITHUB_STEP_SUMMARY