Skip to content

Deploy Site

Deploy Site #149

Workflow file for this run

name: Deploy Site
on:
push:
branches: [main]
# Draft HIPs live only in open pull requests, so refresh the published
# GitHub Pages artifact even when main has not changed.
schedule:
- cron: "0 */6 * * *"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
pull-requests: read
discussions: read
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: hiero-improvement-proposals-linux-medium
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "20"
- name: Install dependencies
working-directory: site
run: npm ci
- name: Test site
working-directory: site
run: npm test
- name: Setup Pages
id: pages
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
- name: Build data
working-directory: site
run: npm run build:data
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REQUIRE_LIVE_DRAFT_HIPS: "true"
- name: Build site
working-directory: site
run: npm run build:app
env:
VITE_BASE: ${{ steps.pages.outputs.base_path }}/
- name: Upload artifact
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: site/dist
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: hiero-improvement-proposals-linux-medium
needs: build
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0
with:
egress-policy: audit
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0