mirror of
https://github.com/monochrome-music/monochrome.git
synced 2026-10-22 02:52:53 -05:00
53 lines
1.5 KiB
YAML
53 lines
1.5 KiB
YAML
name: Deploy
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
concurrency:
|
|
group: deploy-dist
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: blacksmith-4vcpu-ubuntu-2404
|
|
steps:
|
|
- name: Checkout code
|
|
uses: useblacksmith/checkout@v1
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Bun
|
|
uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: latest
|
|
|
|
- name: Install dependencies
|
|
run: bun install
|
|
|
|
- name: Build
|
|
run: bun run build
|
|
|
|
- name: Deploy dist to dist branch
|
|
uses: peaceiris/actions-gh-pages@v4
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_dir: ./dist
|
|
publish_branch: dist
|
|
user_name: github-actions[bot]
|
|
user_email: github-actions[bot]@users.noreply.github.com
|
|
commit_message: 'deploy: ${{ github.sha }}'
|
|
|
|
- name: Trigger deploy hook
|
|
run: |
|
|
if [ -z "${{ secrets.DEPLOY_HOOK_URL }}" ]; then
|
|
echo "DEPLOY_HOOK_URL not set, skipping"
|
|
exit 0
|
|
fi
|
|
echo "Calling deploy hook..."
|
|
curl -fsS -X POST "${{ secrets.DEPLOY_HOOK_URL }}" || curl -fsS "${{ secrets.DEPLOY_HOOK_URL }}"
|