-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (78 loc) · 2.29 KB
/
deploy.yml
File metadata and controls
85 lines (78 loc) · 2.29 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
name: Deploy
on:
push:
branches: [main]
jobs:
changes:
runs-on: ubuntu-latest
outputs:
backend: ${{ steps.filter.outputs.backend }}
api: ${{ steps.filter.outputs.api }}
worker: ${{ steps.filter.outputs.worker }}
titiler: ${{ steps.filter.outputs.titiler }}
steps:
- uses: actions/checkout@v6
- uses: dorny/paths-filter@v4
id: filter
with:
filters: |
backend:
- 'backend/**'
- 'Dockerfile.fly'
api:
- 'backend/**'
- 'Dockerfile.fly'
- 'fly.toml'
worker:
- 'backend/**'
- 'Dockerfile.fly'
- 'fly.worker.toml'
titiler:
- 'fly.titiler.toml'
test:
needs: changes
if: needs.changes.outputs.backend == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Run backend tests
run: |
cd backend
pip install -e ".[dev]"
pytest -v
deploy-api:
needs: [changes, test]
if: needs.changes.outputs.api == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
deploy-worker:
needs: [changes, test]
if: needs.changes.outputs.worker == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only --config fly.worker.toml
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
deploy-titiler:
needs: changes
if: needs.changes.outputs.titiler == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only --config fly.titiler.toml
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
# Frontend auto-deploys via Cloudflare Pages GitHub integration.
# No explicit job needed if you connected the repo in the dashboard.