mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
35 lines
1.0 KiB
YAML
35 lines
1.0 KiB
YAML
name: CD Host
|
|
|
|
on:
|
|
push:
|
|
branches: main
|
|
schedule:
|
|
- cron: '0 */5 * * *'
|
|
workflow_dispatch:
|
|
release:
|
|
types: [created, published, released, edited]
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
host:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: oven-sh/setup-bun@v1
|
|
|
|
- name: Download release assets
|
|
run: |
|
|
DOWNLOAD_URL=$(curl -s https://api.github.com/repos/tresabhi/blitzkit/releases/latest \
|
|
| grep "browser_download_url.*bot.zip" \
|
|
| cut -d : -f 2,3 \
|
|
| tr -d \")
|
|
curl -L -o bot.zip $DOWNLOAD_URL
|
|
mkdir -p dist/bot
|
|
unzip bot.zip -d dist/bot
|
|
|
|
- name: Run bot
|
|
run: mv dist/bot/prisma . && mv dist/bot/node_modules . && mv dist/bot/package.json . && mv dist/bot/.env . && GH_TOKEN=${{ secrets.GH_TOKEN }} DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }} DATABASE_URL=${{ secrets.DATABASE_URL }} DISCORD_CLIENT_ID=${{ secrets.DISCORD_CLIENT_ID }} bun dist/bot/index.js --production
|