-
-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (90 loc) · 3.03 KB
/
pull_request.yaml
File metadata and controls
108 lines (90 loc) · 3.03 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
103
104
105
106
107
108
name: Pull request
on:
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
continuous-integration:
if: github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
outputs:
api-docker-tag: ${{ steps.api-docker-tag.outputs.api-docker-tag }}
env:
COMMON__ENVIRONMENT: Development
steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Install uv
uses: astral-sh/setup-uv@d9e0f98d3fc6adb07d1e3d37f3043649ddad06a1 # v6.5.0
with:
version: ${{ vars.UV_VERSION }}
- name: Install Python
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version-file: .python-version
- name: Install Python packages
run: uv sync --locked
shell: bash
- name: Check code
run: uv run --frozen -- poe check-code
shell: bash
- name: Unit tests
run: uv run --frozen -- pytest -m unit
shell: bash
- name: Integration tests
if: false
run: uv run --frozen -- pytest -m integration
shell: bash
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Set api docker tag
id: api-docker-tag
run: echo "api-docker-tag=myregistry/api:${{ github.event.pull_request.head.sha }}" >> $GITHUB_OUTPUT
- name: Build and push api
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
file: api/src/api/Dockerfile
tags: ${{ steps.api-docker-tag.outputs.api-docker-tag }}
push: false
deploy-api-dev:
needs: continuous-integration
uses: ./.github/workflows/_deploy_api.yaml
with:
environment: dev
docker_tag: ${{ needs.continuous-integration.outputs.api-docker-tag }}
secrets: inherit
deploy-transcriber-dev:
needs: continuous-integration
uses: ./.github/workflows/_deploy_transcriber.yaml
with:
environment: dev
secrets: inherit
deploy-api-stg:
needs: [deploy-api-dev, deploy-transcriber-dev]
uses: ./.github/workflows/_deploy_api.yaml
with:
environment: stg
docker_tag: ${{ needs.continuous-integration.outputs.api-docker-tag }}
secrets: inherit
deploy-transcriber-stg:
needs: [deploy-api-dev, deploy-transcriber-dev]
uses: ./.github/workflows/_deploy_transcriber.yaml
with:
environment: stg
secrets: inherit
deploy-api-pro:
needs: [deploy-api-stg, deploy-transcriber-stg]
uses: ./.github/workflows/_deploy_api.yaml
with:
environment: pro
docker_tag: ${{ needs.continuous-integration.outputs.api-docker-tag }}
secrets: inherit
deploy-transcriber-pro:
needs: [deploy-api-stg, deploy-transcriber-stg]
uses: ./.github/workflows/_deploy_transcriber.yaml
with:
environment: pro
secrets: inherit