-
Notifications
You must be signed in to change notification settings - Fork 64
75 lines (63 loc) · 2.01 KB
/
deploy-ecamp3-logging.yml
File metadata and controls
75 lines (63 loc) · 2.01 KB
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
name: Deploy ecamp3-logging
on:
workflow_dispatch:
inputs:
environment:
description: "Choose environment"
type: environment
required: true
action:
description: "Choose action"
type: choice
required: true
default: diff
options:
- diff
- deploy
jobs:
deploy-ecamp3-logging:
name: "Deploy ecamp3-logging"
runs-on: ubuntu-latest
environment: ${{ github.event.inputs.environment }}
steps:
- name: Validate environment
uses: actions/github-script@v8
with:
script: |
if (!"${{ github.event.inputs.environment }}".startsWith("ecamp3-logging")) {
throw new Error("Environment must start with 'ecamp3-logging'");
}
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Dump secrets to /tmp/secrets.yaml
run: |
cat << 'EOF' | tee -a /tmp/secrets.yaml
${{ toJSON(secrets) }}
EOF
jq '.' /tmp/secrets.yaml
- name: Dump variables to /tmp/env.yaml
run: |
cat << 'EOF' | tee -a /tmp/env.yaml
${{ toJSON(vars) }}
EOF
jq '.' /tmp/env.yaml
- name: Merge secrets and variables
run: |
jq -s '.[0] + .[1]' /tmp/secrets.yaml /tmp/env.yaml > env.yaml
jq '.' env.yaml
working-directory: .ops/ecamp3-logging
- name: Setup helm
run: |
mkdir ~/.kube && echo '${{ secrets.KUBECONFIG }}' > ~/.kube/config && chmod go-r ~/.kube/config
- uses: ./.github/actions/setup-helmfile
- name: Diff deployment
run: |
./deploy.sh diff || true
working-directory: .ops/ecamp3-logging
- name: Show values.yaml
run: cat values.yaml
working-directory: .ops/ecamp3-logging
- name: Deploy
if: ${{ github.event.inputs.action == 'deploy' }}
run: |
./deploy.sh deploy
working-directory: .ops/ecamp3-logging