-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (52 loc) · 2.03 KB
/
deploy.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
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
on:
push:
branches:
- master
name: Gradle Package
env:
PROJECT_NAME: JavaProject
EMAIL_ID: ${{ secrets.EMAIL_ID }}
EMAIL_PWD: ${{ secrets.EMAIL_PWD }}
MONGO_DB: ${{ secrets.MONGO_DB }}
SMTP_CLASS: ${{ secrets.SMTP_CLASS }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
jobs:
deploy:
name: DEPLOY
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: '11.0.12' # The JDK version to make available on the path.
java-package: jdk
- name: Grant execute permission for gradlew
run: chmod +x gradlew
shell: bash
- name: Build with Gradle
run: ./gradlew build --stacktrace
shell: bash
# - name: Make zip file
# run: zip -qq -r ./$GITHUB_SHA.zip .
# shell: bash
- name: Docker Login
# You may pin to the exact commit or the version.
# uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
uses: docker/login-action@v1.10.0
with:
# Server address of Docker registry. If not set then will default to Docker Hub
# registry: # optional
# Username used to log against the Docker registry
username: ${{ secrets.DOCKER_USER }}
# Password or personal access token used to log against the Docker registry
password: ${{ secrets.DOCKER_PWD }}
# Log out from the Docker registry at the end of a job
# logout: # optional, default is true
- name: Docker Image Build
run: docker build --build-arg DEPENDENCY=build/dependency -t asdf1643/java-project .
- name: Upload to DockerHub
run: docker push asdf1643/java-project