-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (52 loc) · 1.91 KB
/
build-and-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
name: Deploy to Wippler k8s
on:
push:
branches:
- master
env:
REPOSITORY: speakerwindows
REGISTRY: d.wplr.rocks
jobs:
build-and-deploy:
name: Deploy
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.REG_USER }}
password: ${{ secrets.REG_PW }}
- name: Build and push Api image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: api/.
push: true
tags: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:api-${{ github.sha }}
- name: Echo public API
run: echo "NEXT_PUBLIC_HOST_URL=https://sw-api.wplr.rocks" > frontend/.env.local
- name: Build and push Frontend image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: frontend/.
push: true
tags: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:frontend-${{ github.sha }}
- name: Updating API
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: kubedeploy
key: ${{ secrets.SSH_KEY }}
port: 22
script: kubectl --namespace web set image deployment/speakerwindows-api api=${{ env.REGISTRY }}/${{ env.REPOSITORY }}:api-${{ github.sha }}
- name: Updating Frontend
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: kubedeploy
key: ${{ secrets.SSH_KEY }}
port: 22
script: kubectl --namespace web set image deployment/speakerwindows-frontend frontend=${{ env.REGISTRY }}/${{ env.REPOSITORY }}:frontend-${{ github.sha }}