-
-
Notifications
You must be signed in to change notification settings - Fork 420
47 lines (45 loc) · 1.34 KB
/
create-release.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 automates release creation and builds and deploys to DockerHub
name: Release project
on:
workflow_dispatch:
inputs:
release_notes:
description: 'Optional notes for the release'
required: false
type: string
jobs:
login:
runs-on: ubuntu-latest
steps:
-
name: Checkout new changes
uses: actions/checkout@v2
with:
java-version: 1.8
fetch-depth: 0
-
name: Get the latest tag in repository
id: TAG
run: |
echo "::set-output name=LATEST_VERSION::$(git tag | sort -Vr | head -n 1)"
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Publish release on GitHub
uses: softprops/action-gh-release@v1
with:
name: 'VulnerableApp-${{ steps.TAG.outputs.LATEST_VERSION }}'
tag_name: '${{ steps.TAG.outputs.LATEST_VERSION }}'
body: '${{ inputs.release_notes }}'
-
name: Grant execute permission for gradlew
run: chmod +x gradlew
-
name: Build and push image to Docker using JIB
run: |
./gradlew jib \
-Djib.to.tags=${{ steps.TAG.outputs.LATEST_VERSION }}