-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (41 loc) · 1.28 KB
/
deploy.yml
File metadata and controls
50 lines (41 loc) · 1.28 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
name: Build, Push & Deploy to Kubernetes
on: [push]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout private repo
uses: actions/checkout@v4
with:
repository: lindenes/configurations
token: ${{ secrets.ACCESS_TOKEN }}
path: configuration
- name: checkout config file
run: |
mv configuration/samurai-face-app/config.yaml .env.local
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
lindenes/face-app:latest
- name: Install kubectl
uses: azure/setup-kubectl@v3
- name: Configure Kubernetes
run: |
mkdir -p ~/.kube
echo "${{ secrets.KUBE_CONFIG }}" > ~/.kube/config
chmod 600 ~/.kube/config
kubectl cluster-info
kubectl get nodes
- name: Rollout Restart Deployment
run: |
kubectl rollout restart deployment/face-app -n prod