Skip to content

Commit

Permalink
Merge pull request #488 from tktcorporation/feature/0/shabeko
Browse files Browse the repository at this point in the history
👷 deploy shabeko to flyio
  • Loading branch information
tktcorporation authored Oct 5, 2024
2 parents 1cecdf8 + ffd341d commit b87a5d7
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 19 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/deploy-tts2-to-fly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "FlyIoDeployTTS-2"

on:
release:
types: [published]

defaults:
run:
shell: bash
working-directory: ./

env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
jobs:
deploy:
name: deploy
runs-on: ubuntu-latest
environment:
name: heroku_production

steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: |
flyctl secrets set -c fly-tts-2.toml \
DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }} \
AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} \
AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} \
AWS_REGION=${{ secrets.AWS_REGION }} \
DISCORD_CMD_PREFIX=${{ secrets.DISCORD_CMD_PREFIX }}
- run: flyctl deploy --remote-only -c fly-tts-2.toml
38 changes: 19 additions & 19 deletions .github/workflows/heroku-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@ jobs:
- name: Install Heroku CLI
run: curl https://cli-assets.heroku.com/install-ubuntu.sh | sh

- name: Set Env Vars on Heroku
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: heroku config:set DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }} DISCORD_CMD_PREFIX=${{ secrets.DISCORD_CMD_PREFIX }} AWS_REGION=${{ secrets.AWS_REGION }} AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} -a ${{ secrets.HEROKU_APP_NAME }}

- name: Login to Heroku Container registry
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: heroku container:login

- name: Build and push
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: cd ./docker && heroku container:push -a ${{ secrets.HEROKU_APP_NAME }} app --context-path ../

- name: Release
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: heroku container:release -a ${{ secrets.HEROKU_APP_NAME }} app
# - name: Set Env Vars on Heroku
# env:
# HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
# run: heroku config:set DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }} DISCORD_CMD_PREFIX=${{ secrets.DISCORD_CMD_PREFIX }} AWS_REGION=${{ secrets.AWS_REGION }} AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} -a ${{ secrets.HEROKU_APP_NAME }}

# - name: Login to Heroku Container registry
# env:
# HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
# run: heroku container:login

# - name: Build and push
# env:
# HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
# run: cd ./docker && heroku container:push -a ${{ secrets.HEROKU_APP_NAME }} app --context-path ../

# - name: Release
# env:
# HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
# run: heroku container:release -a ${{ secrets.HEROKU_APP_NAME }} app
22 changes: 22 additions & 0 deletions fly-tts-2.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
app = "shabeko-discord-bot"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []

[build]
dockerfile = "docker/Dockerfile"

[env]

[experimental]
allowed_public_ports = []
auto_rollback = true

[[services]]
http_checks = []
processes = ["app"]
script_checks = []
[services.concurrency]
hard_limit = 25
soft_limit = 20
type = "connections"
4 changes: 4 additions & 0 deletions fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ processes = []
hard_limit = 25
soft_limit = 20
type = "connections"

[scale]
min = 0
max = 0

0 comments on commit b87a5d7

Please sign in to comment.