Skip to content

feat: add artifact upload step to release index workflow #2

feat: add artifact upload step to release index workflow

feat: add artifact upload step to release index workflow #2

name: Update Release Index
on:
push:
branches:
- 'CR-*'
paths:
- '.github/workflows/release-index.yaml'
- '.github/scripts/release-index/**'
release:
types: [published, edited]
workflow_dispatch:
schedule:
- cron: "0 */6 * * *"
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.TOKEN_GITHUB }}
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: Upload artifact
uses: actions/upload-artifact@v4
with:
name: release-index
path: .github/scripts/release-index/releases/releases.json
retention-days: 30
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
if: success()
with:
github_token: ${{ secrets.TOKEN_GITHUB }}
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