2525 path : ~/.gradle/caches
2626 key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
2727 restore-keys : ${{ runner.os }}-gradle
28+
2829 - name : Build and analyze
2930 env :
3031 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
@@ -33,30 +34,13 @@ jobs:
3334 - uses : actions/upload-artifact@v2
3435 with :
3536 path : build/libs/*.jar
36- deploy :
37- runs-on : ubuntu-latest
38- needs : build
39- steps :
40- - uses : actions/checkout@v2
41- - uses : actions/setup-java@v1
42- with :
43- java-version : 11
44- - name : Cache Gradle packages
45- uses : actions/cache@v1
46- with :
47- path : ~/.gradle/caches
48- key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
49- restore-keys : ${{ runner.os }}-gradle
37+
5038 - uses : docker/login-action@v1
5139 with :
52- username : raeperd
53- password : ${{ secrets.DOCKERHUB_TOKEN }}
54- - name : Get branch name (merge)
55- if : github.event_name != 'pull_request'
56- shell : bash
57- run : echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
58- - name : Get branch name (pull request)
59- if : github.event_name == 'pull_request'
60- shell : bash
61- run : echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV
62- - run : ./gradlew jib -Djib.to.tags=${{ env.BRANCH_NAME }}
40+ registry : ghcr.io/raeperd
41+ username : ${{ github.actor }}
42+ password : ${{ secrets.GITHUB_TOKEN }}
43+ - name : Get branch name
44+ run : echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr /# -)" >> $GITHUB_ENV
45+ - name : Build container image
46+ run : ./gradlew jib -Djib.to.tags=${{ env.BRANCH_NAME }}
0 commit comments