-
-
Notifications
You must be signed in to change notification settings - Fork 405
47 lines (45 loc) · 1.33 KB
/
docker.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
# This workflow will build a Java project with Gradle, create repository tag, and push a new docker image to docker hub
name: Create Tag and Push Image to DockerHub
on:
push:
branches: [ master ]
jobs:
login:
runs-on: ubuntu-latest
steps:
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Checkout new changes
uses: actions/checkout@v2
with:
java-version: 1.8
fetch-depth: 0
-
name: Setup GitVersion action
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
-
name: Execute GitVersion action
id: gitversion
uses: gittools/actions/gitversion/[email protected]
-
name: Create tag for GitHub
uses: tvdias/[email protected]
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
tag: '${{ steps.gitversion.outputs.semver }}'
-
name: Grant execute permission for gradlew
run: chmod +x gradlew
-
name: Build with Gradle and Push
run: |
./gradlew jib \
-Djib.to.image=sasanlabs/owasp-vulnerableapp:unreleased \
-Djib.to.tags=$GITVERSION_SEMVER