Update the Website #114
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: Update the Website | |
| on: | |
| schedule: | |
| - cron: '0 4 * * *' # Runs at midnight every day in EST | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| update_index_page: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Step 1: Check out the repository | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 # Fetch all history for all branches | |
| # Step 2: Set up Python | |
| - name: Set up Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.9' # Adjust the Python version as needed | |
| # Step 3: Set up R | |
| - name: Set up R | |
| uses: r-lib/actions/setup-r@v2 | |
| with: | |
| r-version: '4.1' # Use a stable R version | |
| # Step 4: Cache R packages | |
| - name: Install R Dependencies | |
| uses: r-lib/actions/setup-renv@v2 | |
| with: | |
| cache-version: 1 | |
| # Step 5: Install Quarto (amd64) | |
| - name: Install Quarto | |
| run: | | |
| wget https://github.com/quarto-dev/quarto-cli/releases/download/v1.8.24/quarto-1.8.24-linux-amd64.deb | |
| sudo dpkg -i quarto-1.8.24-linux-amd64.deb | |
| # Step 6: Render all webpages | |
| - name: Render webpage | |
| run: | | |
| quarto render | |
| # Step 7: Check output directory for index.qmd | |
| - name: List _book directory | |
| run: | | |
| ls -l _book | |
| # Step 8: Deploy to GitHub Pages | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.ACTIONS_DEPLOY_KEY2 }} | |
| publish_dir: ./_book | |
| publish_branch: gh-pages |