forked from KubeDev/idc-ms-chatgpt
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (61 loc) · 2.05 KB
/
main.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
name: CI-CD
on:
push:
branches: ["main"]
workflow_dispatch:
jobs:
CI:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Autenticando no Docker Registry
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USR }}
password: ${{ secrets.DOCKERHUB_PWD }}
- name: Docker build chatservice
uses: docker/[email protected]
with:
context: ./chatservice
file: ./chatservice/Dockerfile
push: true
tags: |
fabricioveronez/imersao-chatservice:v${{ github.run_number }}
fabricioveronez/imersao-chatservice:latest
- name: Docker build webapp
uses: docker/[email protected]
with:
context: ./webapp
file: ./webapp/Dockerfile
push: true
tags: |
fabricioveronez/imersao-gpt-webapp:v${{ github.run_number }}
fabricioveronez/imersao-gpt-webapp:latest
CD:
runs-on: ubuntu-latest
needs: [CI]
steps:
- uses: actions/checkout@v3
- name: Autenticar o AWS CLI
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Configuração do OpenAI API Token
shell: bash
run: |
sed -i "s/{{API_TOKEN}}/${{ secrets.OPENAI_API_KEY }}/g" ./k8s/deploy-chatservice.yaml
- name: Configuração do Kubectl
shell: bash
run: |
aws eks update-kubeconfig --name eks-imersao --region us-east-1
- name: Deploy das aplicações
uses: Azure/[email protected]
with:
manifests: |
k8s/deploy-chatservice.yaml
k8s/deploy-webapp.yaml
images: |
fabricioveronez/imersao-chatservice:v${{ github.run_number }}
fabricioveronez/imersao-gpt-webapp:v${{ github.run_number }}