-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (69 loc) · 2.23 KB
/
cd.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
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
name: play-deals-backend 1.0 CD
on:
push:
tags:
- '*'
jobs:
build_image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Cache
uses: actions/cache@v4
with:
path: |
./build
./.gradle
~/.gradle/caches
~/.gradle/wrapper
~/.m2/repository
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3
- name: Build Project with Gradle
uses: gradle/gradle-build-action@v3
with:
arguments: build
- uses: extractions/setup-just@v2
- name: Build and publish image with jib
run: just build-push-image
env:
DOCKER_USER: ${{ github.actor }}
DOCKER_PASSWORD: ${{ github.token }}
deploy_on_k8:
runs-on: ubuntu-latest
needs: build_image
steps:
- uses: actions/checkout@v4
- uses: extractions/setup-just@v2
- uses: azure/setup-helm@v3
- uses: azure/setup-kubectl@v3
id: install
name: Setup kubectl client
- name: create KUBECONFIG
run: |
echo ${{ secrets.KUBE_CONFIG }} | base64 --decode > kube-config;
chmod 600 kube-config;
echo "KUBECONFIG=$(pwd)/kube-config" >> "$GITHUB_ENV"
- name: Deploy on k8
run: |
kubectl config current-context;
just helm-upgrade;
env:
DB_HOST: ${{ secrets.DB_HOST }}
DB_USERNAME: ${{ secrets.DB_USERNAME }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_PORT: ${{ secrets.DB_PORT }}
DB_NAME: ${{ secrets.DB_NAME }}
DASHBOARD: ${{ secrets.DASHBOARD }}
FIREBASE_ADMIN_AUTH_CREDENTIALS: ${{ secrets.FIREBASE_ADMIN_AUTH_CREDENTIALS }}
FOREX_API_KEY: ${{ secrets.FOREX_API_KEY }}
DASHBOARD_USER: ${{ secrets.DASHBOARD_USER }}
DASHBOARD_PASS: ${{ secrets.DASHBOARD_PASS }}