-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (79 loc) · 3.13 KB
/
build-test-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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Deploy
on:
push:
branches:
- main
tags:
- 'prod-*'
env:
RELEASE_VERSION: ${{ github.sha }}
jobs:
deploy-staging:
runs-on: buildjet-2vcpu-ubuntu-2004
#if: ${{ endsWith(github.ref, 'main') || endsWith(github.ref, '') }}
env:
ENV: staging
K8S_SERVER: ${{ secrets.K8S_ENDPOINT_STAGING }}
K8S_TOKEN: ${{ secrets.K8S_TOKEN_STAGING }}
K8S_CA_CERT: ${{ secrets.K8S_CA_CERT_STAGING }}
SLACK_CHANNEL: '#infra-info'
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Render Manifests
run: ./scripts/deploy-release.sh --save-deploy --manifest-dir "manifests-${RELEASE_VERSION}-${ENV}" --debug
- name: Archive Rendered Kubernetes Manifests
uses: actions/upload-artifact@v1
with:
name: "manifests-${{ env.RELEASE_VERSION }}-${{ env.ENV }}"
path: "manifests-${{ env.RELEASE_VERSION }}-${{ env.ENV }}"
- name: Deploy new version
run: ./scripts/deploy-release.sh --apply-deploy --manifest-dir "manifests-${RELEASE_VERSION}-${ENV}" --debug
deploy-prod:
needs: [deploy-staging]
runs-on: buildjet-2vcpu-ubuntu-2004
if: ${{ startsWith(github.ref, 'refs/tags/prod-') }}
env:
ENV: prod
K8S_SERVER: ${{ secrets.K8S_ENDPOINT_PROD }}
K8S_TOKEN: ${{ secrets.K8S_TOKEN_PROD }}
K8S_CA_CERT: ${{ secrets.K8S_CA_CERT_PROD }}
SLACK_CHANNEL: '#infra-info'
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Render Manifests
run: ./scripts/deploy-release.sh --save-deploy --manifest-dir "manifests-${RELEASE_VERSION}-${ENV}" --debug
- name: Archive Rendered Kubernetes Manifests
uses: actions/upload-artifact@v1
with:
name: "manifests-${{ env.RELEASE_VERSION }}-${{ env.ENV }}"
path: "manifests-${{ env.RELEASE_VERSION }}-${{ env.ENV }}"
- name: Deploy new version
run: ./scripts/deploy-release.sh --apply-deploy --manifest-dir "manifests-${RELEASE_VERSION}-${ENV}" --debug
deploy-mcc:
needs: [deploy-staging]
runs-on: buildjet-2vcpu-ubuntu-2004
#if: ${{ startsWith(github.ref, 'refs/tags/prod-') }}
env:
ENV: prod
K8S_SERVER: ${{ secrets.K8S_ENDPOINT_MCC }}
K8S_TOKEN: ${{ secrets.K8S_TOKEN_MCC }}
K8S_CA_CERT: ${{ secrets.K8S_CA_CERT_MCC }}
SLACK_CHANNEL: '#infra-info'
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
FACILITY: MCC
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Render Manifests
run: ./scripts/deploy-release.sh --save-deploy --manifest-dir "manifests-${RELEASE_VERSION}-${FACILITY}" --debug
- name: Archive Rendered Kubernetes Manifests
uses: actions/upload-artifact@v1
with:
name: "manifests-${{ env.RELEASE_VERSION }}-${{ env.FACILITY }}"
path: "manifests-${{ env.RELEASE_VERSION }}-${{ env.FACILITY }}"
- name: Deploy new version
run: ./scripts/deploy-release.sh --apply-deploy --manifest-dir "manifests-${RELEASE_VERSION}-${FACILITY}" --debug