-
-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (77 loc) · 2.44 KB
/
release.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
70
71
72
73
74
75
76
77
78
79
80
81
name: Release
on:
push:
branches: ["main"]
workflow_dispatch:
permissions: "write-all"
concurrency:
group: "release"
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag_version.outputs.new_tag }}
changelog: ${{ steps.tag_version.outputs.changelog }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- 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: azurebot-docker-cache-{hash}
restore-keys: |
azurebot-docker-cache-
continue-on-error: true
- name: Build the Docker image
run: export SCOREBOARD_TAG='${{steps.tag_version.outputs.new_tag}}' && 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 namespace
run: sed -i 's/default/scendingsupport/g' kube-manifest.yml
- name: Replace kubernetes container tag
run: sed -i 's/GIT_SHA/${{ needs.build.outputs.tag }}/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
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ needs.build.outputs.tag }}
name: Release ${{ needs.build.outputs.tag }}
body: "${{ needs.build.outputs.changelog }}"