Files

60 lines
1.6 KiB
YAML

name: Deploy Svelte Site to GitHub Pages
on:
push:
branches: [dev]
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
pages: write
contents: write
id-token: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 23
- name: Setup PNPM
uses: pnpm/action-setup@v4
with:
version: 10
- name: Install Dependencies
run: pnpm install
- name: Fetch Reddit blog post content
run: node scripts/fetch-reddit-posts.mjs
continue-on-error: true # don't fail the build if Reddit is temporarily unavailable
- name: Fetch project board from Wayback Machine
run: node scripts/fetch-project-board.mjs
continue-on-error: true # don't fail the build if Wayback is temporarily unavailable
- name: Build the Site
run: pnpm run build
- name: Upload Artifact
uses: actions/upload-pages-artifact@v3
with:
path: build
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4