-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (46 loc) · 1.39 KB
/
Copy pathcicd.yml
File metadata and controls
56 lines (46 loc) · 1.39 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
56
name: Task Management System CI_CD
on:
pull_request:
branches: [master]
workflow_dispatch:
jobs:
build:
runs-on: self-hosted
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Build dockerfile
run: docker build -t task-app-image .
test:
runs-on: self-hosted
needs: build
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Run tests with Maven
env:
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_URL: ${{ secrets.DB_URL }}
DB_USERNAME: ${{ secrets.DB_USERNAME }}
JWT_LIFE: ${{ secrets.JWT_LIFE }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
SERVER_PORT: ${{ secrets.SERVER_PORT }}
DB_NAME: ${{ secrets.DB_NAME }}
SWAGGER_URL: ${{ secrets.SWAGGER_URL}}
run: mvn test
deploy:
runs-on: self-hosted
needs: test
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Up docker-compose
env:
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_URL: ${{ secrets.DB_URL }}
DB_USERNAME: ${{ secrets.DB_USERNAME }}
JWT_LIFE: ${{ secrets.JWT_LIFE }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
SERVER_PORT: ${{ secrets.SERVER_PORT }}
DB_NAME: ${{ secrets.DB_NAME }}
run: docker compose up -d --force-recreate