-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
62 lines (61 loc) · 1.8 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
name: K8S Setup
description: Prepare kubectl for communication with a cluster
inputs:
vendor:
description: The vendor to communicate with (digitalocean, scaleway)
required: true
cluster-id:
description: Target cluster ID
required: true
# Vendor: DigitalOcean
digitalocean-api-token:
description: DigitalOcean API token
required: false
# Vendor: Scaleway
scaleway-organization-id:
description: Scaleway organization ID
required: false
scaleway-project-id:
description: Scaleway project ID
required: false
scaleway-region:
description: Scaleway deployment region (such as nl-ams)
required: false
scaleway-access-key:
description: Scaleway API key ID
required: false
scaleway-secret-key:
description: Scaleway API key secret
required: false
runs:
using: composite
steps:
- name: Install scw tool
if: ${{ inputs.vendor == 'scaleway' }}
uses: scaleway/action-scw@v0
with:
access-key: ${{ inputs.scaleway-access-key }}
secret-key: ${{ inputs.scaleway-secret-key }}
default-organization-id: ${{ inputs.scaleway-organization-id }}
default-project-id: ${{ inputs.scaleway-project-id }}
export-config: true
save-config: true
- name: Install doctl tool
if: ${{ inputs.vendor == 'digitalocean' }}
uses: digitalocean/action-doctl@v2
with:
token: ${{ inputs.digitalocean-api-token }}
- name: Save kubeconfig
shell: bash
run: |
case "${{ inputs.vendor }}" in
scaleway)
scw k8s kubeconfig install ${{ inputs.cluster-id }} region=${{ inputs.scaleway-region }}
;;
digitalocean)
doctl k8s cluster kubeconfig save ${{ inputs.cluster-id }}
;;
*)
;;
esac