mirror of
https://github.com/samsonjs/spirit-tracker.git
synced 2026-04-14 12:46:04 +00:00
59 lines
1.3 KiB
YAML
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
|