Skip to content

Commit 489b491

Browse files
committed
ci: add Fly deployment and review workflows
1 parent 540bd46 commit 489b491

File tree

4 files changed

+70
-0
lines changed

4 files changed

+70
-0
lines changed

.github/workflows/fly-deploy.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Fly Deploy
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
deploy:
8+
runs-on: ubuntu-latest
9+
environment: production
10+
concurrency: deploy-group
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: superfly/flyctl-actions/setup-flyctl@master
14+
- run: |
15+
flyctl secrets set \
16+
APOLLO_GRAPH_REF=${{ secrets.APOLLO_GRAPH_REF }} \
17+
APOLLO_KEY=${{ secrets.APOLLO_KEY }} \
18+
GITHUB_API_TOKEN=${{ secrets.GH_API_TOKEN }}
19+
flyctl deploy --remote-only
20+
env:
21+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

.github/workflows/fly-review.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Fly Review
2+
on:
3+
pull_request:
4+
types: [opened, reopened, synchronize, closed]
5+
env:
6+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
7+
jobs:
8+
review:
9+
runs-on: ubuntu-latest
10+
concurrency:
11+
group: pr-${{ github.event.number }}
12+
environment:
13+
name: staging
14+
url: ${{ steps.deploy.outputs.url }}
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: superfly/[email protected]
18+
id: deploy
19+
with:
20+
region: yyz
21+
name: ${{ github.event.repository.name }}-pr-${{ github.event.number }}
22+
secrets: |
23+
APOLLO_GRAPH_REF=${{ secrets.APOLLO_GRAPH_REF }}
24+
APOLLO_KEY=${{ secrets.APOLLO_KEY }}
25+
GITHUB_API_TOKEN=${{ secrets.GH_API_TOKEN }}

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
FROM ghcr.io/apollographql/router:v2.1.1
2+
COPY router.yaml /dist/config/router.yaml

fly.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# fly.toml app configuration file generated for dalestudy on 2025-05-03T20:01:41-04:00
2+
#
3+
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
4+
#
5+
6+
app = 'dalestudy'
7+
primary_region = 'yyz'
8+
9+
[build]
10+
11+
[http_service]
12+
internal_port = 8080
13+
force_https = true
14+
auto_stop_machines = 'stop'
15+
auto_start_machines = true
16+
min_machines_running = 0
17+
processes = ['app']
18+
19+
[[vm]]
20+
memory = '1gb'
21+
cpu_kind = 'shared'
22+
cpus = 1

0 commit comments

Comments
 (0)