-
Notifications
You must be signed in to change notification settings - Fork 4
69 lines (57 loc) · 1.56 KB
/
deploy.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
67
68
69
name: Deploy to AKS production cluster
on:
push:
branches:
- main
schedule: # 06:00 UTC Mon-Fri
- cron: '0 6 * * 1-5'
workflow_dispatch:
env:
DOCKER_IMAGE: ghcr.io/dfe-digital/teacher-services-tech-docs
jobs:
deploy:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- run: bundle exec middleman build
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker Image
uses: docker/build-push-action@v3
with:
context: .
tags: |
${{env.DOCKER_IMAGE}}:${{ github.sha }}
${{env.DOCKER_IMAGE}}:latest
push: true
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Set up kubelogin for non-interactive login
uses: azure/use-kubelogin@v1
with:
kubelogin-version: 'v0.0.34'
- uses: azure/aks-set-context@v3
with:
resource-group: s189p01-tsc-pd-rg
cluster-name: s189p01-tsc-production-aks
use-kubelogin: true
admin: 'false'
- name: Deploy to AKS
uses: Azure/k8s-deploy@v4
with:
namespace: bat-production
manifests: |
manifests
images: ${{env.DOCKER_IMAGE}}:${{ github.sha }}
annotate-namespace: false
pull-images: false