-
Notifications
You must be signed in to change notification settings - Fork 55
63 lines (51 loc) · 1.9 KB
/
deploy-ecamp3-logging.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
name: Deploy ecamp3-logging
on:
workflow_dispatch:
inputs:
environment:
description: 'Choose environment'
type: environment
required: true
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@v7
with:
script: |
if (!"${{ github.event.inputs.environment }}".startsWith("ecamp3-logging")) {
throw new Error("Environment must start with 'ecamp3-logging'");
}
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Dump secrets to .env
run: |
echo '${{ toJSON(secrets) }}' | jq -r 'keys[] as $k | select(.[$k] |contains("\n") | not) | "\($k)=\"\(.[$k])\""' >> .env
working-directory: .ops/ecamp3-logging
- name: Dump variables to .env
run: |
echo '${{ toJSON(vars) }}' | jq -r 'keys[] as $k | select(.[$k] |contains("\n") | not) | "\($k)=\"\(.[$k])\""' >> .env
working-directory: .ops/ecamp3-logging
- name: Show .env for debugging
run: echo "$(cat .env | sort)"
working-directory: .ops/ecamp3-logging
- name: Setup helm
run: |
mkdir ~/.kube && echo '${{ secrets.KUBECONFIG }}' > ~/.kube/config && chmod go-r ~/.kube/config
- name: Add helm repositories
run: |
helm repo add fluent https://fluent.github.io/helm-charts
helm repo update
- name: Diff deployment
run: |
./deploy.sh diff || true
working-directory: .ops/ecamp3-logging
- name: Show values.out.yaml
run: cat values.out.yaml
working-directory: .ops/ecamp3-logging
- name: Deploy
run: |
./deploy.sh deploy
working-directory: .ops/ecamp3-logging