-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (53 loc) · 1.63 KB
/
Copy pathci-cd.yaml
File metadata and controls
55 lines (53 loc) · 1.63 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
with:
UV_VERSION: ${{ vars.UV_VERSION }}
PYTHON_VERSION: ${{ vars.PYTHON_VERSION }}
lint:
uses: milsman2/python-app-template/.github/workflows/ruff.yaml@main
needs: cache
with:
UV_VERSION: ${{ vars.UV_VERSION }}
PYTHON_VERSION: ${{ vars.PYTHON_VERSION }}
test:
needs: [lint, cache]
uses: milsman2/python-app-template/.github/workflows/pytest.yaml@main
with:
UV_VERSION: ${{ vars.UV_VERSION }}
PYTHON_VERSION: ${{ vars.PYTHON_VERSION }}
docker-build-and-image-scan:
if: github.event_name == 'push'
needs: test
uses: ./.github/workflows/docker-build-and-scan.yaml
with:
DOCKER_PATH_CONTEXT: .
DOCKER_BUILD_DOCKERFILE: ./Dockerfile
DOCKER_TAGS: ${{ vars.DOCKER_USERNAME }}/${{ vars.DOCKER_REPOSITORY }}:${{ github.sha }}
DOCKER_USERNAME: ${{ vars.DOCKER_USERNAME }}
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
with:
DOCKER_USERNAME: ${{ vars.DOCKER_USERNAME }}
DOCKER_REPOSITORY: ${{ vars.DOCKER_REPOSITORY }}
UV_VERSION: ${{ vars.UV_VERSION }}
PYTHON_VERSION: ${{ vars.PYTHON_VERSION }}
DOCKER_PATH_CONTEXT: .
DOCKER_BUILD_DOCKERFILE: ./Dockerfile