Skip to content

Deploy API (GitHub Pages) #2299

Deploy API (GitHub Pages)

Deploy API (GitHub Pages) #2299

Workflow file for this run

name: Deploy API (GitHub Pages)
on:
push:
branches: [main]
schedule:
- cron: "0 * * * *"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Fetch GitHub stats
run: python3 scripts/fetch-stats.py
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Build static site and API
run: |
rm -rf public
python scripts/API/emit_static_api.py
mkdir -p public
cp -a public_html/. public/
echo "[ls] public/"
ls -la public/
echo "[ls] public/api/"
ls -la public/api/
echo "[ls] public/api/v1/"
ls -la public/api/v1/
test -f public/api/v1/index.json
test -f public/api/v1/search-index.json
test -f public/api/v1/manifest.json
- name: Debug Queue Manager in built API
run: |
jq '.plugins[] | select(.repo=="GabiRP/QueueManager")' public/api/v1/index.json || true
jq '.[] | select(.repo=="GabiRP/QueueManager")' public/api/v1/plugins.json || true
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./public
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4