-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (45 loc) · 1.71 KB
/
jib-build.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
48
49
50
51
name: Build & push docker image and deploy to environment
on:
workflow_call:
outputs:
app_version:
description: The version of the app as generated by create_app_version
value: ${{ jobs.docker_build.outputs.version }}
permissions:
contents: read
packages: write
jobs:
docker_build:
name: Build docker image
runs-on: ubuntu-latest
outputs:
version: ${{ steps.app_version.outputs.version }}
steps:
- id: app_version
name: Application version creators
uses: ministryofjustice/hmpps-github-actions/.github/actions/build-test-and-deploy/create_app_version@v2 # WORKFLOW_VERSION
- uses: actions/checkout@v4
- name: refresh cache
id: initial-cache
uses: actions/cache@v4
env:
cache-name: kotlin-cache
with:
path: |
- gradle-{{ checksum "build.gradle.kts" }}
- gradle-
key: ${{ runner.os }}-gradle-${{ env.cache-name }}-${{ hashFiles('build.gradle.kts') }}
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'gradle'
cache-dependency-path: |
*.gradle*
**/gradle-wrapper.properties
- run: ./gradlew jib --image="${IMAGE_NAME}:${BUILD_NUMBER}" -Djib.to.auth.username=${GITHUB_USERNAME} -Djib.to.auth.password=${GITHUB_PASSWORD} -Djib.to.tags=latest -Djib.container.environment=BUILD_NUMBER="${BUILD_NUMBER}"
env:
GITHUB_USERNAME: ${{ github.actor }}
GITHUB_PASSWORD: ${{ github.token }}
BUILD_NUMBER: ${{ steps.app_version.outputs.version }}
IMAGE_NAME: "ghcr.io/ministryofjustice/probation-offender-search"