File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Build
2+
3+ on :
4+ push :
5+ tags :
6+ - " v*.*.*"
7+
8+ env :
9+ REGISTRY : ghcr.io
10+ IMAGE_NAME : ${{ github.repository }}
11+
12+ jobs :
13+ build :
14+ name : Build & Push Docker Image
15+ runs-on : ubuntu-latest
16+ permissions :
17+ contents : read
18+ packages : write
19+
20+ steps :
21+ - name : Checkout
22+ uses : actions/checkout@v4
23+
24+ - name : Set up JDK 21
25+ uses : actions/setup-java@v4
26+ with :
27+ java-version : " 21"
28+ distribution : " temurin"
29+
30+ - name : Setup Gradle
31+ uses : gradle/actions/setup-gradle@v4
32+
33+ - name : Extract tag version
34+ id : version
35+ run : echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
36+
37+ - name : Log in to GitHub Container Registry
38+ uses : docker/login-action@v3
39+ with :
40+ registry : ${{ env.REGISTRY }}
41+ username : ${{ github.actor }}
42+ password : ${{ secrets.GITHUB_TOKEN }}
43+
44+ - name : Build and push image via Jib
45+ run : |
46+ ./gradlew jib \
47+ -Djib.to.image=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} \
48+ -Djib.to.tags=${{ steps.version.outputs.VERSION }},latest \
49+ -Djib.to.auth.username=${{ github.actor }} \
50+ -Djib.to.auth.password=${{ secrets.GITHUB_TOKEN }} \
51+ -Pversion=${{ steps.version.outputs.VERSION }}
You can’t perform that action at this time.
0 commit comments