Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 48 additions & 11 deletions .github/workflows/check-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,59 @@ jobs:
checkAppVersions:
name: Check for current app versions and re-build site if they changed
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Query releases from MissingCore Music
id: music_versions
run: |
echo "MUSIC_LATEST_TAG=$(gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2026-03-10" \
/repos/MissingCore/Music/releases/latest
--jq '.tag_name')" >> $GITHUB_ENV
echo "MUSIC_RECENT_TAG=$(gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2026-03-10" \
/repos/MissingCore/Music/releases?per_page=1
--jq '.[0].tag_name')" >> $GITHUB_ENV
echo "Latest Tag: $MUSIC_LATEST_TAG, Most Recent Tag: $MUSIC_LATEST_TAG"
MUSIC_LATEST_TAG=$(gh release list \
--repo MissingCore/Music \
--exclude-drafts \
--exclude-pre-releases \
--limit 1 \
--json tagName \
--jq '.[0].tagName // empty')

MUSIC_RECENT_TAG=$(gh release list \
--repo MissingCore/Music \
--exclude-drafts \
--limit 1 \
--json tagName \
--jq '.[0].tagName // empty')

echo "MUSIC_LATEST_TAG=$MUSIC_LATEST_TAG" >> "$GITHUB_OUTPUT"
echo "MUSIC_RECENT_TAG=$MUSIC_RECENT_TAG" >> "$GITHUB_OUTPUT"

echo "Latest Tag: ${MUSIC_LATEST_TAG:-none}, Most Recent Tag: ${MUSIC_RECENT_TAG:-none}"

- name: Write versions to `.env.local` file and commit
run: |
if [ -z "${{ steps.music_versions.outputs.MUSIC_LATEST_TAG }}" ] || \
[ -z "${{ steps.music_versions.outputs.MUSIC_RECENT_TAG }}" ]; then
echo "One or both tags are empty; skipping write/commit."
exit 1
fi
echo "PUBLIC_MUSIC_LATEST_TAG=${{ steps.music_versions.outputs.MUSIC_LATEST_TAG }}" > .env.local
echo "PUBLIC_MUSIC_RECENT_TAG=${{ steps.music_versions.outputs.MUSIC_RECENT_TAG }}" >> .env.local

git config user.name github-actions
git config user.email github-actions@github.com

# Commit changes to `.env.local`
git add .env.local

# Capture current time and format it (YYYY-MM-DD HH:MM:SS)
CURRENT_TIME=$(date +"%Y-%m-%d %H:%M:%S")

if git diff --cached --quiet; then
echo "No changes to .env.local; nothing to commit."
else
git commit -m "[ci] Automatic Version Check $CURRENT_TIME"
git push
fi
17 changes: 17 additions & 0 deletions .github/workflows/deploy-vercel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Deploy to Vercel
on:
push:
branches:
- main
workflow_dispatch:

jobs:
deploy:
name: Deploy to Vercel using Deploy Hook
runs-on: ubuntu-latest
steps:
- name: Run Deploy Hook
env:
VERCEL_DEPLOY_HOOK: ${{ secrets.VERCEL_DEPLOY_HOOK }}
run: |
curl --fail --silent --show-error "$VERCEL_DEPLOY_HOOK"