hex/.github/workflows/site.yml
Dax 5f0170e47b
Site: a push to production deploys the production site; the mode follows the branch (#403)
site.yml runs on pushes to dev and production (site/ and the installers it copies) and derives the mode from the ref: production -> production, dev -> dev; dispatch follows the ref too, with no mode input. site-deploy.yml refuses a deploy whose mode doesn't match its branch.
2026-10-29 16:30:16 -04:00

57 lines
1.7 KiB
YAML

name: Site
# Builds site/ and checks every download link on pull requests. A push (or a
# dispatch) on dev deploys the dev site (https://dev.anoma.ly/hex); on
# production, which moves only by a fast-forward from dev, the production
# site (https://anoma.ly/hex). The mode always follows the branch.
on:
pull_request:
paths:
- "site/**"
- ".github/workflows/site.yml"
- ".github/workflows/site-deploy.yml"
- ".github/release/deploy-site.sh"
- ".github/release/cf/**"
- ".github/release/install-linux.sh"
- ".github/release/install-windows.ps1"
push:
branches: [dev, production]
paths:
- "site/**"
- ".github/workflows/site.yml"
- ".github/workflows/site-deploy.yml"
- ".github/release/deploy-site.sh"
- ".github/release/cf/**"
- ".github/release/install-linux.sh"
- ".github/release/install-windows.ps1"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: site-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
defaults:
run:
working-directory: site
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
with:
persist-credentials: false
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
- run: bun install --frozen-lockfile
- run: bun run build
- run: bun run check:downloads
deploy:
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/production')
uses: ./.github/workflows/site-deploy.yml
with:
mode: ${{ github.ref == 'refs/heads/production' && 'production' || 'dev' }}
secrets: inherit