generated from owl-corp/python-template
-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (64 loc) · 1.76 KB
/
main.yaml
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
name: main
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
changes:
runs-on: ubuntu-latest
outputs:
backend: ${{ steps.changes.outputs.backend }}
frontend: ${{ steps.changes.outputs.frontend }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
automation: &automation
- '.github/workflows/**'
- 'deployments/**'
backend:
- *automation
- 'thallium-backend/**'
frontend:
- *automation
- 'thallium-frontend/**'
generate-inputs:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
outputs:
sha-tag: ${{ steps.sha-tag.outputs.sha-tag }}
steps:
- name: Create SHA Container Tag
id: sha-tag
run: |
tag=$(cut -c 1-7 <<< $GITHUB_SHA)
echo "sha-tag=$tag" >> $GITHUB_OUTPUT
lint-backend:
uses: ./.github/workflows/lint-backend.yaml
lint-frontend:
uses: ./.github/workflows/lint-frontend.yaml
build-backend:
if: ${{ needs.changes.outputs.backend == 'true' }}
needs: [changes, generate-inputs, lint-backend]
uses: ./.github/workflows/build-deploy.yaml
with:
sha-tag: ${{ needs.generate-inputs.outputs.sha-tag }}
project: backend
secrets: inherit
build-frontend:
if: ${{ needs.changes.outputs.frontend == 'true' }}
needs: [changes, generate-inputs, lint-frontend]
uses: ./.github/workflows/build-deploy.yaml
with:
sha-tag: ${{ needs.generate-inputs.outputs.sha-tag }}
project: frontend
dockerfile: Dockerfile.development
secrets: inherit