-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy-fly.yml
More file actions
102 lines (93 loc) · 2.52 KB
/
deploy-fly.yml
File metadata and controls
102 lines (93 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Deploy to Fly.io
on:
push:
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
deploy:
name: Deploy to Fly.io
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Fly CLI
uses: superfly/flyctl-actions/setup-flyctl@master
- name: Deploy to Fly.io
run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
# Alternative: Deploy with build arguments
# deploy-with-args:
# name: Deploy with Build Args
# runs-on: ubuntu-latest
# environment: production
# steps:
# - uses: actions/checkout@v4
# - uses: superfly/flyctl-actions/setup-flyctl@master
# - run: |
# flyctl deploy --remote-only \
# --build-arg NODE_ENV=production \
# --build-arg COMMIT_SHA=${{ github.sha }}
# env:
# FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
# Alternative: Deploy to staging first
# deploy-staging:
# name: Deploy to Staging
# runs-on: ubuntu-latest
# environment: staging
# steps:
# - uses: actions/checkout@v4
# - uses: superfly/flyctl-actions/setup-flyctl@master
# - run: flyctl deploy --remote-only --config fly.staging.toml
# env:
# FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
#
# deploy-production:
# name: Deploy to Production
# runs-on: ubuntu-latest
# needs: deploy-staging
# environment: production
# steps:
# - uses: actions/checkout@v4
# - uses: superfly/flyctl-actions/setup-flyctl@master
# - run: flyctl deploy --remote-only
# env:
# FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
# Required secrets:
# - FLY_API_TOKEN: Fly.io API token (generate with `flyctl tokens create deploy`)
#
# fly.toml (required, place in repo root):
# app = 'your-app-name'
# primary_region = 'iad'
#
# [build]
#
# [http_service]
# internal_port = 3000
# force_https = true
# auto_stop_machines = 'stop'
# auto_start_machines = true
# min_machines_running = 0
# processes = ['app']
#
# [[vm]]
# memory = '1gb'
# cpu_kind = 'shared'
# cpus = 1
#
# [checks]
# [checks.health]
# grace_period = "30s"
# interval = "15s"
# method = "get"
# path = "/health"
# port = 3000
# timeout = "10s"
# type = "http"
#
# Setting secrets in Fly.io:
# flyctl secrets set DATABASE_URL="..." API_KEY="..."