-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (45 loc) · 1.21 KB
/
Copy pathdeploy.yml
File metadata and controls
49 lines (45 loc) · 1.21 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
name: deploy
on:
workflow_dispatch:
push:
branches: [main]
paths:
- "src/**"
- "Dockerfile"
- "infra/**"
- "pyproject.toml"
- ".github/workflows/deploy.yml"
permissions:
id-token: write
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v3
with:
enable-cache: true
- run: uv sync --extra rag
- run: uv run ruff check src tests scripts eval
- run: uv run pytest
deploy:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_DEPLOY_ROLE_ARN }}
aws-region: ${{ vars.AWS_REGION || 'us-east-1' }}
- uses: actions/setup-node@v4
with: { node-version: "20" }
- run: npm install -g aws-cdk
- uses: astral-sh/setup-uv@v3
with:
enable-cache: true
- run: uv sync --extra infra
- run: uv run cdk deploy --require-approval never --outputs-file cdk-out.json
working-directory: infra
- name: Show API URL
run: jq -r '.CanAID.ApiUrl' infra/cdk-out.json