Skip to content

Commit

Permalink
Deploy to fly from main
Browse files Browse the repository at this point in the history
  • Loading branch information
mraerino committed Apr 28, 2024
1 parent 9ed831e commit fdbb24c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ jobs:
permissions:
contents: read
packages: write

outputs:
imageTag: ${{ steps.meta.outputs.tags }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
Expand Down Expand Up @@ -52,3 +53,15 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

deploy:
name: Deploy backend
runs-on: ubuntu-latest
concurrency: deploy-group # ensure only one action runs at a time
needs: build-and-push-image
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@1.5
- run: flyctl deploy --image ${{ needs.build-and-push-image.outputs.imageTag }}
env:
FLY_API_TOKEN: ${{ secrets.FLY_DEPLOY_TOKEN }}
25 changes: 25 additions & 0 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
app = 'ffddorf-terraform-backend'
primary_region = 'ams'

[mounts]
source = "ffddorf_terraform_data"
destination = "/data"

[env]
STORAGE_FS_DIR = "/data/states"
LOCK_BACKEND = "sqlite"
LOCK_SQLITE_FILE = "/data/locks.db"
AUTH_GITHUB_ORG = "ffddorf"

[http_service]
internal_port = 8080
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
processes = ['app']

[[vm]]
memory = '256mb'
cpu_kind = 'shared'
cpus = 1

0 comments on commit fdbb24c

Please sign in to comment.