-
Notifications
You must be signed in to change notification settings - Fork 8
66 lines (66 loc) · 2.49 KB
/
orgchart.yaml
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: orgchart
"on":
push:
branches:
- master
workflow_dispatch: {}
env:
ACR_RESOURCE_GROUP: acrworkflow1678335186783
AZURE_CONTAINER_REGISTRY: orgchart
CLUSTER_NAME: gig-aks
CLUSTER_RESOURCE_GROUP: GIG
CONTAINER_NAME: org-chart
DEPLOYMENT_MANIFEST_PATH: |
./deployment/orgchart-deployment.yaml
./deployment/orgchart-ingress.yaml
./deployment/orgchart-service.yaml
jobs:
buildImage:
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: azure/login@v1.4.3
name: Azure login
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
- name: Build and push image to ACR
run: az acr build --image ${{ env.CONTAINER_NAME }}:${{ github.sha }} --registry ${{ env.AZURE_CONTAINER_REGISTRY }} -g ${{ env.ACR_RESOURCE_GROUP }} --build-arg SERVER_URL=${{secrets.SERVER_URL}} --build-arg PUBLIC_URL=${{secrets.PUBLIC_URL}} -f ./Dockerfile ./
deploy:
permissions:
actions: read
contents: read
id-token: write
runs-on: ubuntu-latest
needs:
- buildImage
steps:
- uses: actions/checkout@v3
- uses: azure/login@v1.4.3
name: Azure login
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
- uses: azure/use-kubelogin@v1
name: Set up kubelogin for non-interactive login
with:
kubelogin-version: v0.0.25
- uses: azure/aks-set-context@v3
name: Get K8s context
with:
admin: "false"
cluster-name: ${{ env.CLUSTER_NAME }}
resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }}
use-kubelogin: "true"
- uses: Azure/k8s-deploy@v4
name: Deploys application
with:
action: deploy
images: ${{ env.AZURE_CONTAINER_REGISTRY }}.azurecr.io/${{ env.CONTAINER_NAME }}:${{ github.sha }}
manifests: ${{ env.DEPLOYMENT_MANIFEST_PATH }}
namespace: applications