-
Notifications
You must be signed in to change notification settings - Fork 33
79 lines (69 loc) · 2.23 KB
/
ci.yml
File metadata and controls
79 lines (69 loc) · 2.23 KB
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
name: CI
on:
push:
branches:
- main
workflow_dispatch:
inputs:
tag:
description: 'Release tag (use "latest" for default environment)'
required: false
default: 'latest'
appVersion:
description: 'Application version'
required: false
default: '0.0.1'
branch:
description: 'Branch to use'
required: false
default: 'main'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4.1.3
with:
ref: ${{ inputs.branch }}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
registry: docker.io
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push API image
uses: docker/build-push-action@v3
with:
context: Backend
file: Backend/Dockerfile
push: true
tags: |
georgii4inferara/soroban-security-portal:1.0.${{ github.run_number }}
georgii4inferara/soroban-security-portal:${{ inputs.tag || 'latest' }}
- name: Build and push UI image
uses: docker/build-push-action@v3
with:
context: UI
file: UI/Dockerfile
push: true
tags: |
georgii4inferara/soroban-security-portal-ui:1.0.${{ github.run_number }}
georgii4inferara/soroban-security-portal-ui:${{ inputs.tag || 'latest' }}
- name: Setup Helm
uses: azure/setup-helm@v4
with:
version: 'latest'
- name: Package and push Helm chart
env:
APP_VERSION: ${{ inputs.appVersion }}
BUILD_VERSION: "1.0.${{ github.run_number }}"
run: |
# Compute versions
valuesFile="Deploy/helm/values.yaml"
# Update tag in values.yaml
sed -i 's/tag: .*/tag: "'"$BUILD_VERSION"'"/' Deploy/helm/values.yaml
# Package and push
helm package Deploy/helm/ --app-version "$APP_VERSION" --version "$BUILD_VERSION"
helm push sorobansecurityportal-"$BUILD_VERSION".tgz oci://registry-1.docker.io/georgii4inferara