spirit-tracker/.github/workflows/pages.yaml
Brennan Wilkes (Text Groove) 8ff73428a2 more sku work
2026-01-20 13:53:32 -08:00

59 lines
1.3 KiB
YAML

name: Deploy visualizer to GitHub Pages
on:
push:
branches: [data]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout data branch
uses: actions/checkout@v4
with:
ref: data
- name: Configure Pages
uses: actions/configure-pages@v4
# Make sku_links.json available to the static site without committing a second copy.
- name: Stage sku_links.json into site artifact
shell: bash
run: |
set -euo pipefail
mkdir -p viz/data
if [[ -f data/sku_links.json ]]; then
cp -f data/sku_links.json viz/data/sku_links.json
else
# keep site functional even if file is missing
cat > viz/data/sku_links.json <<'EOF'
{
"generatedAt": "",
"links": [],
"ignores": []
}
EOF
fi
- name: Upload site artifact
uses: actions/upload-pages-artifact@v3
with:
path: viz
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4