-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
46 lines (46 loc) · 1.32 KB
/
action.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
name: 'setup-k8s-action'
description: 'Setup k8s tools, config and populate KUBECONFIG env variable'
inputs:
environment:
required: true
description: the environment to deploy to
default: staging
config-production:
required: true
description: k8s configuration for production
config-staging:
required: true
description: k8s configuration for staging
location:
default: .kube/config
description: The location of the config
runs:
using: "composite"
steps:
- shell: bash
run: |
echo "Unknown environment: ${{ inputs.environment }}"
exit 1
if: (inputs.environment != 'production' && inputs.environment != 'staging')
- uses: yokawasa/[email protected]
with:
kubectl: '1.31.2'
# supports env vars > to secrets/configs
kustomize: '4.5.7'
setup-tools: |
kubectl
kustomize
kubeconform
helm
- run: mkdir -p .kube
shell: bash
- run: 'echo "${{ inputs.config-production }}" > ${{ inputs.location }}'
if: inputs.environment == 'production'
shell: bash
- run: 'echo "${{ inputs.config-staging }}" > ${{ inputs.location }}'
if: inputs.environment == 'staging'
shell: bash
- run: echo 'KUBECONFIG=${{ inputs.location }}' >> $GITHUB_ENV
shell: bash
- run: cat $KUBECONFIG
shell: bash