-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (37 loc) · 1.13 KB
/
develop-deploy.yml
File metadata and controls
46 lines (37 loc) · 1.13 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
name: Develop Deployment
on:
push:
branches:
- develop
jobs:
build-and-push-dev:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Cache Maven Dependencies
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
- name: Build Application
run: mvn clean verify
- name: Build Docker Image
run: |
docker build \
-t nayanmoni458/stoneinscription:dev-latest \
-t nayanmoni458/stoneinscription:sha-${GITHUB_SHA::7} .
- name: Login To Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push Docker Images
run: |
docker push nayanmoni458/stoneinscription-backend:dev-latest
docker push nayanmoni458/stoneinscription-backend:sha-${GITHUB_SHA::7}