-
Notifications
You must be signed in to change notification settings - Fork 4
36 lines (32 loc) · 1.05 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
name: Deploy docker image
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Restore gradle dependencies
uses: actions/cache@v2
with:
path: "~/.gradle"
key: ${{ runner.os }}-modules-${{ hashFiles('build.gradle') }}
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: "11"
distribution: "adopt"
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
- name: Build jar
run: ./gradlew build -x test
- name: Push docker image
run: |
# Docker login
docker login -u="${{ secrets.DOCKER_HUB_USERNAME }}" -p="${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}"
GIT_HASH=$(git rev-parse --short HEAD)
docker build -t thewca/db-sanity-check:latest -t thewca/db-sanity-check:$GIT_HASH .
docker push thewca/db-sanity-check --all-tags