-
Notifications
You must be signed in to change notification settings - Fork 5
51 lines (46 loc) · 1.82 KB
/
production.yml
File metadata and controls
51 lines (46 loc) · 1.82 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
name: production
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up environment variables
run: |
cat > frontend/.env << EOF
VITE_API_URL=https://login.threefold.me/
VITE_OPENKYC_URL=https://openkyc.threefold.me/
VITE_DEEPLINK=threebot://
EOF
- name: Build the Docker image
run: docker build . --file Dockerfile --tag ghcr.io/${{ github.repository_owner }}/threefold-connect:production-${{ github.sha }}
- name: Push the Docker image
run: docker push ghcr.io/${{ github.repository_owner }}/threefold-connect:production-${{ github.sha }}
deploy:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set authorization certificate
run: |
mkdir ${HOME}/.kube
echo ${{ secrets.KUBE_KEY }} | base64 --decode > ${HOME}/.kube/jimber-prod2.key
echo ${HOME}/.kube/jimber-prod2.key
echo ${{ secrets.KUBE_CRT }} | base64 --decode > ${HOME}/.kube/jimber-prod2.crt
echo ${HOME}/.kube/jimber-prod2.crt
- name: context
run: |
echo ${{ secrets.KUBE_CONFIG }} | base64 --decode > ${HOME}/.kube/config
- name: Upgrade production on cluster
run: |
echo production-${{ github.sha }}
helm upgrade threebotlogin helm_files -f helm_files/valuesProduction.yaml --set images.login.tag=production-${{ github.sha }} --set images.login.repo=ghcr.io/${{ github.repository_owner }}/threefold-connect -n jimber