Skip to content

Commit 067ca1e

Browse files
committed
seprate test and release ci pipelines
1 parent f6385e0 commit 067ca1e

File tree

5 files changed

+148
-51
lines changed

5 files changed

+148
-51
lines changed

.github/workflows/docker-build-push.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Evaluate
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
jobs:
8+
test-python:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v4.0.0
13+
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: '3.12.x'
18+
architecture: 'x64'
19+
cache: 'pip'
20+
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install -r requirements.txt
25+
26+
- name: Test with pytest
27+
run: |
28+
pip install pytest pytest-cov
29+
pytest
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Evaluate Frontend
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
paths:
8+
'frontend/*'
9+
10+
jobs:
11+
test-nextjs:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4.0.0
16+
17+
- name: build nextjs app
18+
run: |
19+
docker build -t ai-chatbot-framework_frontend:dev -f frontend/Dockerfile frontend/
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Release Backend
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
release:
8+
types: [published]
9+
10+
jobs:
11+
push_to_registry:
12+
name: Push Docker image to Docker Hub
13+
runs-on: ubuntu-latest
14+
permissions:
15+
packages: write
16+
contents: read
17+
attestations: write
18+
id-token: write
19+
steps:
20+
- name: Check out the repo
21+
uses: actions/checkout@v4
22+
23+
- name: Log in to Docker Hub
24+
uses: docker/login-action@v3
25+
with:
26+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
27+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
28+
29+
- name: Extract metadata (tags, labels) for Docker
30+
id: meta
31+
uses: docker/metadata-action@v5
32+
with:
33+
images: ${{ secrets.DOCKER_HUB_USERNAME }}/ai-chatbot-framework_backend
34+
35+
- name: Build and push Docker image
36+
id: push
37+
uses: docker/build-push-action@v6
38+
with:
39+
context: .
40+
file: ./Dockerfile
41+
push: true
42+
tags: ${{ steps.meta.outputs.tags }}
43+
labels: ${{ steps.meta.outputs.labels }}
44+
45+
- name: Generate artifact attestation
46+
uses: actions/attest-build-provenance@v2
47+
with:
48+
subject-name: ${{ secrets.DOCKER_HUB_USERNAME }}/ai-chatbot-framework_backend
49+
subject-digest: ${{ steps.push.outputs.digest }}
50+
push-to-registry: true
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Release Frontend
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
release:
8+
types: [published]
9+
10+
jobs:
11+
push_to_registry:
12+
name: Push Docker image to Docker Hub
13+
runs-on: ubuntu-latest
14+
permissions:
15+
packages: write
16+
contents: read
17+
attestations: write
18+
id-token: write
19+
steps:
20+
- name: Check out the repo
21+
uses: actions/checkout@v4
22+
23+
- name: Log in to Docker Hub
24+
uses: docker/login-action@v3
25+
with:
26+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
27+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
28+
29+
- name: Extract metadata (tags, labels) for Docker
30+
id: meta
31+
uses: docker/metadata-action@v5
32+
with:
33+
images: ${{ secrets.DOCKER_HUB_USERNAME }}/ai-chatbot-framework_frontend
34+
35+
- name: Build and push Docker image
36+
id: push
37+
uses: docker/build-push-action@v6
38+
with:
39+
context: .
40+
file: ./frontend/Dockerfile
41+
push: true
42+
tags: ${{ steps.meta.outputs.tags }}
43+
labels: ${{ steps.meta.outputs.labels }}
44+
45+
- name: Generate artifact attestation
46+
uses: actions/attest-build-provenance@v2
47+
with:
48+
subject-name: ${{ secrets.DOCKER_HUB_USERNAME }}/ai-chatbot-framework_frontend
49+
subject-digest: ${{ steps.push.outputs.digest }}
50+
push-to-registry: true

0 commit comments

Comments
 (0)