-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (29 loc) · 991 Bytes
/
Copy pathdocker-image.yml
File metadata and controls
38 lines (29 loc) · 991 Bytes
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
name: Docker Image Push
on:
push:
branches: [ "main" ]
pull_request:
jobs:
package-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Build the Docker image
run: docker build . --file Dockerfile --tag reece-address-book-system:v1
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_ACCESS_KEY }}
- name: tag docker image
run: docker tag reece-address-book-system:v1 mansoorsarfraz/reece-address-book-system:v1
- name: push Docker image
run: docker push mansoorsarfraz/reece-address-book-system:v1