Skip to content

Commit c555dad

Browse files
authored
Update and rename github-actions-demo.yml to deploy.yml
1 parent 0b29ef7 commit c555dad

File tree

2 files changed

+35
-18
lines changed

2 files changed

+35
-18
lines changed

.github/workflows/deploy.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build, Push & Deploy to Kubernetes
2+
on: [push]
3+
4+
jobs:
5+
build-and-deploy:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout
9+
uses: actions/checkout@v4
10+
11+
- name: Login to Docker Hub
12+
uses: docker/login-action@v3
13+
with:
14+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
15+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
16+
17+
- name: Build and Push Docker Image
18+
uses: docker/build-push-action@v5
19+
with:
20+
context: .
21+
push: true
22+
tags: |
23+
lindenes/face-app:latest
24+
25+
- name: Install kubectl
26+
uses: azure/setup-kubectl@v3
27+
28+
- name: Configure Kubernetes
29+
run: |
30+
echo "${{ secrets.KUBE_CONFIG }}" > kubeconfig.yaml
31+
export KUBECONFIG=kubeconfig.yaml
32+
33+
- name: Rollout Restart Deployment
34+
run: |
35+
kubectl rollout restart deployment/face-app -n prod

.github/workflows/github-actions-demo.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)