ci: add github pages workflow #3
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: Deploy to GitHub Pages | |
| # Updates the GitHub pages website with the changes made in the last push. | |
| # builds the newest version of the website using astro. | |
| on: | |
| schedule: [cron: '0 0 1 1 *'] # updates the copyright at the footer | |
| workflow_dispatch: | |
| push: | |
| branches: [main, master, release, development] | |
| paths: | |
| - ".github/workflows/push--deploy-github-pages.yaml" | |
| - "redirects.yml" | |
| - "src/**" | |
| - "package*" | |
| - tailwind.config.* | |
| - astro.config.* | |
| - tsconfig.* | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: github-pages | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| name: Build site | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| # Fails randomly and unexpectedly, cannot reproduce. | |
| # - name: Check the links | |
| # uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2.8.0 | |
| # with: { fail: true, args: redirects.yaml --no-progress --verbose } | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5.0.0 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6.1.0 | |
| with: { node-version: 24 } | |
| - name: Install all dependencies | |
| run: npm ci | |
| - name: Build site | |
| run: npm run build | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0 | |
| with: { path: ./dist } | |
| deploy: | |
| name: Deploy site | |
| 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@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0 |