-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (42 loc) · 1.48 KB
/
build_container.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
# Workflow requires Variables to be defined as follows:
# secrets.GHCR_USER -> User to push to GHCR
# secrets.GITHUB_TOKEN -> Password with rights to push to GHCR
name: "Build And Push Container"
on:
release:
types:
- released
jobs:
docker_image:
name: Generate Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
persist-credentials: false
- name: Get Release Version
id: release
uses: GuillaumeFalourd/get-release-or-tag@v2
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Build Docker Image
run: ./gradlew jibDockerBuild
- name: Login to Github Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USER }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push CSV Service to Github Container Registry
run: docker push --all-tags ghcr.io/es-ude/elastic-ai.cloud.service.csv
- name: Push enV5 Twin to Github Container Registry
run: docker push --all-tags ghcr.io/es-ude/elastic-ai.cloud.twin.env5
- name: Push Monitor to Github Container Registry
run: docker push --all-tags ghcr.io/es-ude/elastic-ai.cloud.monitor