-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (65 loc) · 2.44 KB
/
release.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
name: Workflow for release packages
on:
push:
tags:
- "v*.*.*"
jobs:
release-package-ci:
runs-on: ubuntu-22.04
environment: prd
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Go 1.23.x 🐹
uses: actions/setup-go@v4
with:
go-version: '1.23.x'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Grant execute permissions
run: chmod +x *
working-directory: ./scripts
- name: Run Unit tests
run: ./run-test.sh -u
working-directory: ./scripts
- name: Spin up external storage services
run: |
docker compose up -d postgres azure-blob-storage
- name: Install apt dependencies for integration test
run: |
sudo apt-get update
sudo apt-get install -y openssl opensc softhsm libssl-dev libengine-pkcs11-openssl
- name: Run Integration tests
run: sudo ./run-test.sh -i
working-directory: ./scripts
- name: Shut down external storage services
run: |
docker compose down -v
# Run static code analysis on source code
# Run vulnerability scanner and generate SBOMs on third part dependencies
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Read version from file
id: get_version
run: |
# Check if the version file exists and read its content
if [ -f version ]; then
version=$(cat version)
echo "VERSION=$version" >> $GITHUB_ENV
else
echo "Version file not found!"
exit 1
fi
- name: Build and push Docker image for REST backend
run: |
BACKEND_TAG="${{ secrets.DOCKER_USERNAME }}/crypto-vault-rest-service:${{ env.VERSION }}"
docker build -t $BACKEND_TAG -f cmd/crypto-vault-rest-service/Dockerfile .
docker push $BACKEND_TAG
- name: Build and push Docker image for gRPC backend
run: |
BACKEND_TAG="${{ secrets.DOCKER_USERNAME }}/crypto-vault-grpc-service:${{ env.VERSION }}"
docker build -t $BACKEND_TAG -f cmd/crypto-vault-grpc-service/Dockerfile .
docker push $BACKEND_TAG