-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (48 loc) · 1.42 KB
/
Copy pathci-cd.yaml
File metadata and controls
55 lines (48 loc) · 1.42 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
name: CI/CD Pipeline
on:
push:
branches:
- '**'
tags:
- 'v*.*.*'
pull_request:
branches:
- '**'
workflow_dispatch:
jobs:
cache:
uses: milsman2/python-app-template/.github/workflows/cache-uv-build.yaml@main
lint:
uses: milsman2/python-app-template/.github/workflows/ruff.yaml@main
needs: cache
test:
needs: [lint, cache]
uses: milsman2/python-app-template/.github/workflows/pytest.yaml@main
docker-build-and-image-scan:
if: github.event_name == 'push'
needs: test
uses: milsman2/python-app-template/.github/workflows/docker-build-and-scan.yaml@main
with:
DOCKER_PATH_CONTEXT: .
DOCKER_BUILD_DOCKERFILE: ./Dockerfile
DOCKER_TAGS: ${{ github.repository }}:${{ github.sha }}
DOCKER_LOAD_BOOL: false
DOCKER_PUSH_BOOL: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }}
secrets: inherit
release:
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
needs: [test, docker-build-and-image-scan]
uses: ./.github/workflows/release.yaml
permissions:
contents: write
secrets: inherit
trigger-auto-merge:
needs: release
if: needs.release.result == 'success'
uses: ./.github/workflows/auto-merge-on-release.yml
permissions:
contents: write
pull-requests: write
with:
head_branch: ${{ github.ref_name }}
secrets: inherit