-
Notifications
You must be signed in to change notification settings - Fork 1
88 lines (70 loc) · 2.79 KB
/
deploy.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
name: Build and Push Docker image
on:
release:
types: [published]
jobs:
build_and_push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Set up SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
name: id_rsa
known_hosts: ${{ secrets.SSH_HOST }}
- name: Set up Git
run: git config --global url.ssh://[email protected]/.insteadOf https://github.com/
- name: Login to Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- name: Set up Google Cloud CLI
uses: google-github-actions/setup-gcloud@v2
- name: Configure Google Cloud Docker registry
run: gcloud auth configure-docker europe-west1-docker.pkg.dev
- name: Build and push frontend Docker image
uses: docker/build-push-action@v2
with:
push: true
tags: europe-west1-docker.pkg.dev/openfort/dockers/sample-ecosystem-backend:${{ github.event.release.tag_name }}
file: ./ecosystem-wallet/backend/Dockerfile
context: ./ecosystem-wallet/backend
build-args: |
"SSH_PRIVATE_KEY=${{ secrets.SSH_PRIVATE_KEY }}"
- name: Build and push backend Docker image
uses: docker/build-push-action@v2
with:
push: true
tags: europe-west1-docker.pkg.dev/openfort/dockers/sample-ecosystem-frontend:${{ github.event.release.tag_name }}
file: ./ecosystem-wallet/frontend/Dockerfile
context: ./ecosystem-wallet/frontend
build-args: |
"SSH_PRIVATE_KEY=${{ secrets.SSH_PRIVATE_KEY }}"
- name: Set up yq
uses: chrisdickinson/setup-yq@latest
with:
version: 4.30.8
- name: Clone Infra Repository
run: |
git clone [email protected]:openfort-xyz/kube-prod.git
- name: Update frontend version
uses: mikefarah/yq@master
with:
cmd: yq -i '.sample_ecosystem_frontend.tag = "${{ github.event.release.tag_name }}"' kube-prod/overrides.yaml
- name: Update backend version
uses: mikefarah/yq@master
with:
cmd: yq -i '.sample_ecosystem_backend.tag = "${{ github.event.release.tag_name }}"' kube-prod/overrides.yaml
- name: Update Infra Repository
run: |
cd kube-prod
git config --global user.email "[email protected]"
git config --global user.name "CD"
git add .
git commit -m "Update ecosystem sample version to ${{ github.event.release.tag_name }}"
git push
- name: Logout of Docker CLI
run: docker logout europe-west1-docker.pkg.dev