-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (31 loc) · 1012 Bytes
/
publish-ghcr.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
name: Docker Image CI for GHCR
on:
push
jobs:
build_and_publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Set up JDK 1.21
uses: actions/setup-java@v2
with:
java-version: '21'
distribution: 'adopt'
- name: Build the package
run: mvn --batch-mode -DskipTests package
- name: Run the unit tests
run: mvn --batch-mode -Dmaven.test.failure.ignore=true test
- name: Report
uses: dorny/test-reporter@v1
if: always()
with:
name: Maven Tests
path: target/surefire-reports/*.xml
reporter: java-junit
fail-on-error: true
- name: Build and push the image
run: |
docker login --username abankhele --password ${{secrets.ACCESS_TOKEN}} ghcr.io
docker build -t ghcr.io/abankhele/prime-service:latest --file Dockerfile .
docker push ghcr.io/abankhele/prime-service:latest