-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (86 loc) · 2.78 KB
/
bobapp-workflow.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: BobApp Workflow
run-name: ${{ github.actor }} is using Bobapp Workflow
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
Frontend-Angular:
timeout-minutes: 10
name: Frontend-Angular
runs-on: ubuntu-latest
defaults:
run:
working-directory: 'front'
steps:
- name: Check out repository code
uses: actions/checkout@v3
#Added for CI/CD workflow
- name: npm dependencies
run: npm install
#Frontend tests and coverage
- name: Running tests
run: npm test -- --watch=false --code-coverage --browsers=ChromeHeadless
- name: Upload reports
uses: actions/upload-artifact@v2
with:
name: Frontend-coverage-report
path: front/coverage/
Backend-Jacoco-coverage:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Build with Maven
run: mvn -B package --file pom.xml
working-directory: back
- name: Run tests and generate JaCoCo report
run: mvn -B clean verify
working-directory: back
- name: Upload JaCoCo report
uses: actions/upload-artifact@v2
with:
name: Backend-jacoco-report
path: back/target/site/jacoco
Docker-push:
timeout-minutes: 10
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: achmoye/repo-test
- name: Build and push Docker image (front)
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: ./front
file: ./front/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Build and push Docker image (back)
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: ./back
file: ./back/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}