-
Notifications
You must be signed in to change notification settings - Fork 1
90 lines (77 loc) · 2.4 KB
/
k8s-quarkus-sync.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Quarkus Sync Build & Deploy on k8s
on:
push:
branches: [ main, feature/k8s-deployment ]
pull_request:
branches: [ main ]
permissions:
contents: read
packages: write
jobs:
build:
name: build & push
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./bookstore-quarkus-sync
env:
QUARKUS_HTTP_ROOT_PATH: /
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: assemble
run: ./gradlew assemble
- name: build container
run: ./gradlew build -x test -Dquarkus.container-image.build=true
- uses: azure/k8s-set-context@v3
with:
method: kubeconfig
kubeconfig: '${{ secrets.KUBECONFIG }}'
- name: Helm Deploy to k8s
uses: vimeda/[email protected]
with:
release: 'bookstore-quarkus-sync'
namespace: 'benchmarks'
chart: 'bookstore-quarkus-sync/helm'
token: '${{ secrets.GITHUB_TOKEN }}'
values: |
image:
tag: ${{ github.sha }}
env:
KUBECONFIG_FILE: '${{ secrets.KUBECONFIG }}'
- name: push & deploy to k8s
run: |
./gradlew build -x test \
-Dquarkus.kubernetes.deploy=true \
-Dquarkus.kubernetes.generate-image-pull-secret=true \
-Dquarkus.container-image.group=${{ github.repository_owner }}/${{ github.event.repository.name }} \
-Dquarkus.container-image.registry=ghcr.io \
-Dquarkus.container-image.additional-tags=${{ github.sha }} \
-Dquarkus.container-image.username=${{ github.actor }} \
-Dquarkus.container-image.password=${{ secrets.GITHUB_TOKEN }}
# deploy:
# name: deploy to k8s
# runs-on: ubuntu-latest
# needs: build
#
# steps:
# - uses: actions/checkout@v3
#
# - name: Helm Deploy to k8s
# uses: vimeda/[email protected]
# with:
# release: 'bookstore-quarkus-sync'
# namespace: 'benchmarks'
# chart: 'bookstore-quarkus-sync/helm'
# token: '${{ secrets.GITHUB_TOKEN }}'
# values: |
# image:
# tag: ${{ github.sha }}
# env:
# KUBECONFIG_FILE: '${{ secrets.KUBECONFIG }}'