Deploy bot #159
This file contains 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: Deploy bot | |
on: | |
workflow_dispatch: | |
release: | |
types: [published] | |
jobs: | |
run: | |
name: Deploy bot | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Setup Node.JS | |
uses: actions/[email protected] | |
with: | |
node-version: 20.6.0 | |
cache: npm | |
- name: Download autos data | |
run: | |
curl "https://gist.githubusercontent.com/${{ secrets.PRIVATE_GIST | |
}}/raw/autos-data.ts" --output modules/automod/autos-data.ts | |
- name: Download bad words | |
run: | |
curl "https://gist.githubusercontent.com/${{ secrets.PRIVATE_GIST | |
}}/raw/bad-words.ts" --output modules/automod/bad-words.ts | |
- name: Download dad | |
run: | |
curl "https://gist.githubusercontent.com/${{ secrets.PRIVATE_GIST }}/raw/dad.ts" | |
--output modules/auto/dad.ts | |
- name: Download strings | |
run: | |
curl "https://gist.githubusercontent.com/${{ secrets.PRIVATE_GIST | |
}}/raw/strings.ts" --output common/strings.ts | |
- name: Checkout images | |
run: git clone https://gist.github.com/${{ secrets.IMAGES_GIST }}.git scripts/images | |
- name: Install | |
run: npm ci --force | |
- name: Link | |
run: npx railway link --environment production b8b10332-30c2-4b72-8999-78c69ddcd63a | |
env: | |
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }} | |
- name: Deploy | |
run: npx railway up --detach | |
env: | |
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }} | |
- name: Clean DB listeners | |
run: | |
curl https://sa-discord.up.railway.app/clean-database-listeners?auth=${{ | |
secrets.CDBL_AUTH }} |