Deploy to GitHub Pages #2120
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 | |
| on: | |
| schedule: | |
| - cron: '25 6 * * *' # Daily at 06:25 UTC | |
| workflow_dispatch: | |
| push: | |
| branches: [production] | |
| jobs: | |
| build: | |
| name: Build Website | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v6 | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Setup Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '24' | |
| cache: 'npm' | |
| - name: Install NPM Dependencies | |
| run: npm ci | |
| - name: Run Nuxt Build | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NUXT_PUBLIC_SITE_URL: https://www.babdev.com | |
| run: npx nuxt build --preset github_pages | |
| - name: Upload Artifact | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: ./.output/public | |
| deploy: | |
| name: Deploy Website | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |