-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (39 loc) · 1.13 KB
/
ci.yaml
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
name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'corretto'
- name: Set up Gradle
uses: gradle/gradle-build-action@v2
id: setup-gradle
with:
gradle-version: 8.3
- name: Build
run: gradle build -i
- name: Unit Tests
run: gradle runUnitTests -i
- name: Integration Tests
run: gradle runIntegrationTests -i
- name: Build Image
run: docker build -t maezzedine/personal-space:latest -t maezzedine/personal-space:${{ github.run_number }} .
- name: Login to Docker Hub
uses: docker/login-action@v1
if: github.event_name == 'push'
with:
username: maezzedine
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Publish Images
if: github.event_name == 'push'
run: docker push maezzedine/personal-space --all-tags