File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,11 +16,16 @@ jobs:
1616 uses : actions/setup-java@v1
1717 with :
1818 java-version : ${{ env.JAVA_VERSION }}
19+ - name : Extract branch name
20+ shell : bash
21+ run : echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
22+ id : extract_branch
1923 - uses : actions/checkout@v2
2024 with :
2125 fetch-depth : 0
2226 - name : Build and Publish Docker Image
2327 env :
2428 REGISTRY_USER : ${{ secrets.REGISTRY_USER }}
2529 REGISTRY_PASSWORD : ${{ secrets.REGISTRY_PASSWORD }}
30+ BRANCH_NAME : ${{ steps.extract_branch.outputs.branch }}
2631 run : ./gradlew jib
File renamed without changes.
Original file line number Diff line number Diff line change @@ -19,10 +19,12 @@ repositories {
1919 }
2020}
2121
22+ var outputImage = ' togetherjava.duckdns.org:5001/togetherjava/tjbot:' + System . getenv(' BRANCH_NAME' ) ?: ' latest'
23+
2224jib {
2325 from. image = ' adoptopenjdk/openjdk16:alpine-slim'
2426 to {
25- image = ' togetherjava.duckdns.org:5001/togetherjava/tjbot:latest '
27+ image = outputImage
2628 auth {
2729 username = System . getenv(' REGISTRY_USER' ) ?: ' '
2830 password = System . getenv(' REGISTRY_PASSWORD' ) ?: ' '
You can’t perform that action at this time.
0 commit comments