-
Notifications
You must be signed in to change notification settings - Fork 1
33 lines (28 loc) · 904 Bytes
/
jib.yaml
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
name: Build and Push Docker image with Jib
on:
push:
branches: [ "main" ]
tags: [ "*" ]
pull_request:
branches: [ "main" ]
jobs:
build-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Run Jib plugin with Gradle Wrapper
env:
REF_NAME: ${{ github.head_ref || github.ref_name }}
run: |
if [ "$GITHUB_REF_TYPE" == "tag" ]; then
ADDITIONAL_TAGS="$REF_NAME,latest"
else
ADDITIONAL_TAGS="$REF_NAME"
fi
./gradlew jib \
-Djib.to.image=ghcr.io/invictoprojects/streetly-shop:$GITHUB_SHA \
-Djib.to.tags=$ADDITIONAL_TAGS \
-Djib.to.auth.username=${{ github.repository_owner }} \
-Djib.to.auth.password=${{ secrets.GITHUB_TOKEN }}