Skip to content

Commit

Permalink
actually just autostop all machines
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaellaude committed Oct 23, 2024
1 parent efc1e4a commit 04937cb
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 60 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/fly-deploy-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ jobs:
echo "::set-output name=name::${{ github.event.repository.name }}-${{ github.event.number }}-db"
# manually launch and deploy the api app
- name: launch api app
- name: Launch API
if: github.event.action != 'closed'
run: |
app="${{ github.event.repository.name }}-${{ github.event.number }}-api"
db_name="${{ github.event.repository.name }}-${{ github.event.number }}-db"
config="fly-pr.toml"
config="fly.toml"
# Check if the app exists
if flyctl apps list | grep -q "$app"; then
Expand All @@ -94,7 +94,7 @@ jobs:
echo "api_app_name=$app" >> $GITHUB_ENV
working-directory: backend

- name: deploy api app
- name: Deploy API
if: github.event.action != 'closed'
run: |
flyctl secrets set \
Expand All @@ -108,7 +108,7 @@ jobs:
DATABASE_URL="postgresql://postgres:${{ secrets.FLY_PR_PG_PASSWORD }}@${{ steps.fork-db.outputs.name }}.flycast:5432/districtr_v2_api?sslmode=disable&options=-csearch_path%3Dpublic"
flyctl deploy \
--config fly-pr.toml --app "${{ github.event.repository.name }}-${{ github.event.number }}-api" \
--config fly.toml --app "${{ github.event.repository.name }}-${{ github.event.number }}-api" \
--strategy immediate '--ha=false' --vm-cpu-kind shared --vm-cpus 1 --vm-memory 256
working-directory: backend

Expand All @@ -118,7 +118,7 @@ jobs:
run: |
app="${{ github.event.repository.name }}-${{ github.event.number }}-app"
api_app="${{ github.event.repository.name }}-${{ github.event.number }}-api"
config="fly-pr.toml"
config="fly.toml"
# Check if the app exists
if flyctl apps list | grep -q "$app"; then
Expand All @@ -138,11 +138,11 @@ jobs:
echo "frontend_app_name=$app" >> $GITHUB_ENV
working-directory: app

- name: Deploy Frontend App
- name: Deploy frontend
if: github.event.action != 'closed'
run: |
app_name="${{ github.event.repository.name }}-${{ github.event.number }}-app"
config="fly-pr.toml"
config="fly.toml"
flyctl secrets set \
-a "${{ github.event.repository.name }}-${{ github.event.number }}-app" \
Expand Down
17 changes: 0 additions & 17 deletions app/fly-pr.toml

This file was deleted.

4 changes: 2 additions & 2 deletions app/fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ primary_region = 'ewr'
[http_service]
internal_port = 3000
force_https = true
auto_stop_machines = true
auto_stop_machines = "stop"
auto_start_machines = true
min_machines_running = 1
min_machines_running = 0
processes = ['app']

[[vm]]
Expand Down
32 changes: 0 additions & 32 deletions backend/fly-pr.toml

This file was deleted.

4 changes: 2 additions & 2 deletions backend/fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ primary_region = 'ewr'
[http_service]
internal_port = 8080
force_https = true
auto_stop_machines = true
auto_stop_machines = "stop"
auto_start_machines = true
min_machines_running = 1
min_machines_running = 0
processes = ['app']

[[vm]]
Expand Down

0 comments on commit 04937cb

Please sign in to comment.