Skip to content

Commit 362b579

Browse files
committed
💚 Improve CI
1 parent 69a16b6 commit 362b579

File tree

2 files changed

+11
-61
lines changed

2 files changed

+11
-61
lines changed

Diff for: .github/workflows/CI-CD.yaml

+6-61
Original file line numberDiff line numberDiff line change
@@ -7,69 +7,14 @@ on:
77
pull_request:
88
branches: ["dev"]
99

10-
env:
11-
REGISTRY: ghcr.io
12-
IMAGE_NAME: ${{ github.repository }}
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
1313

1414
jobs:
1515
tests:
16-
name: Run tests
17-
runs-on: ubuntu-latest
18-
steps:
19-
- uses: actions/checkout@v4
20-
- name: Setup PDM
21-
uses: pdm-project/setup-pdm@v4
22-
with:
23-
cache: true
24-
- name: Install dependencies
25-
run: pdm install -d
26-
- name: Run linting check
27-
run: pdm run lint --check
28-
- name: Run tests
29-
run: pdm run tests
30-
- name: Export requirements
31-
run: pdm run export
32-
- name: Check for changes
33-
if: contains(github.actor, 'renovate[bot]') == false
34-
run: git diff --exit-code HEAD requirements.txt
16+
uses: ./.github/workflows/test.yaml
17+
3518
docker:
3619
needs: tests
37-
runs-on: ubuntu-latest
38-
permissions:
39-
contents: read
40-
packages: write
41-
id-token: write
42-
steps:
43-
- name: Checkout repository
44-
uses: actions/checkout@v4
45-
46-
- name: Set up Docker Buildx
47-
uses: docker/[email protected]
48-
49-
- name: Log into registry ${{ env.REGISTRY }}
50-
uses: docker/[email protected]
51-
with:
52-
registry: ${{ env.REGISTRY }}
53-
username: ${{ github.actor }}
54-
password: ${{ secrets.GITHUB_TOKEN }}
55-
56-
- name: Extract Docker metadata for
57-
id: meta
58-
uses: docker/[email protected]
59-
with:
60-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
61-
tags: |
62-
type=ref,event=branch
63-
type=ref,event=pr
64-
type=ref,event=tag
65-
type=sha
66-
67-
- name: Build and push Docker image
68-
uses: docker/[email protected]
69-
with:
70-
context: .
71-
push: true
72-
tags: ${{ steps.meta.outputs.tags }}
73-
labels: ${{ steps.meta.outputs.labels }}
74-
cache-from: type=gha
75-
cache-to: type=gha,mode=max
20+
uses: ./.github/workflows/docker.yaml

Diff for: .github/workflows/docker.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
name: Build and Push Docker Image
2+
3+
env:
4+
REGISTRY: ghcr.io
5+
IMAGE_NAME: ${{ github.repository }}
6+
27
jobs:
38
docker:
49
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)