Build and Deploy Site #38
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: Build and Deploy Site | |
| on: | |
| push: | |
| branches: ["main"] | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 0 * * *' | |
| # Grant permission to modify the website directly | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Pandoc | |
| run: sudo apt-get update && sudo apt-get install -y pandoc | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install Dependencies | |
| run: pip install -r requirements.txt | |
| - name: Build Site | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: python build.py | |
| - name: Upload Artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: './public' | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |