-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (51 loc) · 1.73 KB
/
prod.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
name: CICD Production
on:
push:
branches:
- main
env:
NOCODB_API_TOKEN: ${{ secrets.NOCODB_API_TOKEN }}
NOCODB_API_URL: ${{ secrets.NOCODB_API_URL }}
NOCODB_COMPANY_DB: ${{ secrets.NOCODB_COMPANY_DB }}
NOCODB_SEMINAR_DB: ${{ secrets.NOCODB_SEMINAR_DB }}
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GTK_STG }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v6
with:
push: true
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ghcr.io/ce-smart-career/${{ github.event.repository.name }}-prd:latest
secrets: |
NOCODB_API_TOKEN=${{ secrets.NOCODB_API_TOKEN }}
NOCODB_API_URL=${{ secrets.NOCODB_API_URL }}
NOCODB_COMPANY_DB=${{ secrets.NOCODB_COMPANY_DB }}
NOCODB_SEMINAR_DB=${{ secrets.NOCODB_SEMINAR_DB }}
deploy:
name: Deploy
needs: build
runs-on: label-1
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Deploy to our k8s
run: |
microk8s kubectl apply -f deploy/deployment.yml
microk8s kubectl rollout restart deployment/ce-smart-career-frontend-prd -n ce-smart-career
microk8s kubectl apply -f deploy/service.yml
microk8s kubectl apply -f deploy/ingress.yml