Update Dashboard #14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Dashboard | |
on: | |
schedule: | |
- cron: '0 0 * * 0' # Every Sunday at 00:00 UTC | |
workflow_dispatch: | |
jobs: | |
update-dashboard: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- name: Install dependencies | |
run: bun install | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 9 | |
run_install: false | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- name: Clone blast repository | |
run: | | |
git clone https://github.com/BlastLauncher/blast.git blast_clone | |
- name: Install blast dependencies | |
run: | | |
cd blast_clone | |
pnpm install --frozen-lockfile | |
pnpm run build | |
- name: Generate dashboard markdown | |
run: | | |
bun run index.ts -w --repo $(pwd)/blast_clone/packages/blast-api | |
- name: Preserve dashboard.md | |
run: | | |
if [ -f dashboard.md ]; then | |
mv dashboard.md ../dashboard.md.tmp | |
else | |
echo "dashboard.md not found, skipping move" | |
fi | |
- name: Checkout dashboard branch in fresh folder | |
run: | | |
mkdir dashboard_repo | |
cd dashboard_repo | |
git init | |
git remote add origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git | |
git fetch origin dashboard || true | |
if git ls-remote --exit-code origin dashboard; then | |
git checkout dashboard | |
else | |
git checkout -b dashboard | |
fi | |
if [ -f ../../dashboard.md.tmp ]; then | |
cp ../../dashboard.md.tmp README.md | |
else | |
echo "No dashboard.md.tmp found, creating empty README.md" | |
touch README.md | |
fi | |
- name: Commit and push README.md | |
run: | | |
cd dashboard_repo | |
git config user.email "actions@github.com" | |
git config user.name "GitHub Actions" | |
git add README.md | |
git commit -m "Update README.md [skip ci]" || echo "No changes to commit" | |
git push --set-upstream origin dashboard |