-
-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (64 loc) · 2.01 KB
/
test.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
name: Test Release
on:
pull_request:
branches: ["main"]
concurrency:
group: "test-release"
cancel-in-progress: false
permissions: "write-all"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Run Tests
run: make test
- name: Cache docker layers
uses: satackey/[email protected]
with:
key: scoreboard-docker-cache-{hash}
restore-keys: |
scoreboard-docker-cache-
continue-on-error: true
- name: Build the Docker image
run: export SCOREBOARD_TAG='${{ github.event.pull_request.head.sha }}' && make docker-release
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Kubectl
uses: Azure/setup-kubectl@v3
- name: Login to Azure
uses: azure/aks-set-context@v1
with:
creds: "${{ secrets.AZURE_CREDENTIALS }}"
resource-group: "k8s-homelab"
cluster-name: "homelab"
id: login
- name: Replace kubernetes environment
run: sed -i 's/live/test/g' kube-manifest.yml
- name: Replace kubernetes namespace
run: sed -i 's/default/scendingsupport/g' kube-manifest.yml
- name: Replace kubernetes container tag
run: sed -i 's/GIT_SHA/${{ github.event.pull_request.head.sha }}/g' kube-manifest.yml
- name: Deploy to Kubernetes
uses: Azure/[email protected]
timeout-minutes: 5
with:
action: "deploy"
namespace: "scendingsupport"
strategy: "basic"
manifests: |
kube-manifest.yml