Skip to content

Build and Deploy

Build and Deploy #42

Workflow file for this run

name: Build and Deploy
on:
push:
branches: [main]
discussion:
types: [created, edited, labeled, unlabeled, category_changed, deleted]
workflow_dispatch:
permissions:
contents: read
discussions: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
test:
uses: ./.github/workflows/test.yml
secrets: inherit
build:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
cache: 'npm'
- uses: lowlydba/sustainable-npm@v2
- run: npm ci
- name: Fetch discussions
run: npm run fetch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build site
run: npx astro build
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v4
with:
path: dist
deploy:
needs: [test, build]
runs-on: ubuntu-slim
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4