Skip to content

update-release-index #3

update-release-index

update-release-index #3

name: update-release-index
on:
release:
types: [published, edited]
workflow_dispatch:
concurrency:
group: release-index
cancel-in-progress: false
jobs:
build-index:
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: .github/scripts/release-index/package-lock.json
- name: Install dependencies
working-directory: .github/scripts/release-index
run: npm ci
- name: Build Release Index
working-directory: .github/scripts/release-index
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: node build-releases.js
timeout-minutes: 2
- name: Verify output
working-directory: .github/scripts/release-index
run: |
if [ ! -f releases/releases.json ]; then
echo "Error: releases.json not generated"
exit 1
fi
echo "✓ Release index generated successfully"
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
if: success()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: .github/scripts/release-index/releases
publish_branch: gh-pages
user_name: "github-actions[bot]"
user_email: "github-actions[bot]@users.noreply.github.com"
commit_message: "Update release index - ${{ github.run_number }}"
enable_jekyll: false