-
Notifications
You must be signed in to change notification settings - Fork 143
65 lines (57 loc) · 2.04 KB
/
Copy pathdeploy-api.yml
File metadata and controls
65 lines (57 loc) · 2.04 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
name: Deploy API to Fly
on:
push:
branches: [main]
paths:
- "services/api/**"
- "packages/types/**"
- "marketplace/**"
- "plugins/**"
- "scripts/build_marketplace.py"
- "infra/fly/api/**"
- ".github/workflows/deploy-api.yml"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: deploy-api
cancel-in-progress: true
jobs:
deploy:
name: Deploy aisoc-demo-api
runs-on: ubuntu-latest
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install flyctl
uses: superfly/flyctl-actions/setup-flyctl@master
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
# Mirror infra/fly/fly-demo-deploy.sh::stage_marketplace_index. The api
# Dockerfile does `COPY . .` against services/api/, so anything outside
# that dir is invisible to the image. /api/v1/marketplace returns 503
# without index.json present at /app/marketplace/index.json in the image.
- name: Stage marketplace/index.json into services/api
run: |
python3 -m pip install --quiet pyyaml
python3 scripts/build_marketplace.py
mkdir -p services/api/marketplace
cp marketplace/index.json services/api/marketplace/index.json
ls -la services/api/marketplace/
# The api Dockerfile was written assuming build context = services/api/
# (it does `COPY pyproject.toml ./` and `COPY . .`). flyctl deploy uses
# its cwd as the build context, so we cd into services/api/ and pass an
# absolute path to the fly.toml so flyctl still finds it. This mirrors
# the deploy_app() helper in infra/fly/fly-demo-deploy.sh.
- name: Deploy to Fly (context=services/api)
working-directory: services/api
run: |
flyctl deploy \
--remote-only \
--config "${GITHUB_WORKSPACE}/infra/fly/api/fly.toml" \
--app aisoc-demo-api