-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (43 loc) · 1.24 KB
/
dev-ci.yml
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
name: dev CI
on:
push:
branches: [ "dev" ]
pull_request:
branches: [ "dev" ]
jobs:
unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build the Docker image for unit test
run: docker build --target unittest . --file Dockerfile --tag profile-unit-test:latest
- name: Run unit test
run: docker run -t profile-unit-test
integration-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run integration test
run: docker compose -f docker-compose.test.yml run --rm backend
- name: stop and remove containers
run: docker compose down
build:
if: github.event_name == 'push'
needs: [unit-test, integration-test]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build Docker image
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Ship to Docker Hub
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: profileorg/profile-be-dev