Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
25403f865e | ||
|
|
f6e83f6681 | ||
|
|
b88fbf4ad6 | ||
|
|
fe5edd2387 | ||
|
|
50d08134cc | ||
|
|
1c88fc9f2b | ||
|
|
16b4bea4f4 | ||
|
|
34de7de05e | ||
|
|
f326ba7d79 | ||
|
|
7ba18097f4 | ||
|
|
192e5a2aa5 | ||
|
|
a17bf21ca2 |
@@ -11,7 +11,7 @@ To use this action, add the following step to your GitHub Action workflow:
|
||||
|
||||
Keep in mind that the action expects a base64 encoded string of your Kubernetes configuration. The simplest way to do that is to run `cat $HOME/.kube/config | base64` and save that output as an action secret.
|
||||
|
||||
It's also possible to specify the version of the [kubectl](https://kubernetes.io/docs/reference/kubectl/) CLI to use. The current default release used by this action is `v1.23.0`.
|
||||
It's also possible to specify the version of the [kubectl](https://kubernetes.io/docs/reference/kubectl/) CLI to use. The current default release used by this action is `v1.26.0`.
|
||||
```yaml
|
||||
- uses: tale/kubectl-action@v1
|
||||
with:
|
||||
|
||||
@@ -8,16 +8,20 @@ inputs:
|
||||
kubectl-version:
|
||||
description: Version of the kubectl CLI to use
|
||||
required: false
|
||||
default: v1.23.0
|
||||
default: v1.26.0
|
||||
base64-kube-config:
|
||||
description: A base64 encoded reference to your authorization file (~/.kube/config)
|
||||
required: true
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- run: echo "${{ github.action_path }}" >> $GITHUB_PATH
|
||||
shell: bash
|
||||
- name: Configure kubectl CLI
|
||||
run: setup-kubectl.sh
|
||||
shell: bash
|
||||
env:
|
||||
KUBECTL_VERSION: ${{ inputs.kubectl-version }}
|
||||
- name: Authorize kubectl to the cluster
|
||||
run: login-kubectl.sh
|
||||
shell: bash
|
||||
|
||||
0
login-kubectl.sh
Normal file → Executable file
0
login-kubectl.sh
Normal file → Executable file
13
setup-kubectl.sh
Normal file → Executable file
13
setup-kubectl.sh
Normal file → Executable file
@@ -1,9 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
curl -LO "https://dl.k8s.io/release/${{ inputs.kubectl-version }}/bin/linux/amd64/kubectl"
|
||||
curl -LO "https://dl.k8s.io/${{ inputs.kubectl-version }}/bin/linux/amd64/kubectl.sha256"
|
||||
echo "$(cat kubectl.sha256) kubectl" | sha256sum --check
|
||||
curl -LO "https://dl.k8s.io/release/$KUBECTL_VERSION/bin/linux/amd64/kubectl"
|
||||
curl -LO "https://dl.k8s.io/$KUBECTL_VERSION/bin/linux/amd64/kubectl.sha256"
|
||||
echo "$(cat kubectl.sha256) kubectl" | sha256sum --check
|
||||
rm -f kubectl.sha256
|
||||
|
||||
mkdir $GITHUB_WORKSPACE/bin
|
||||
mv kubectl $GITHUB_WORKSPACE/bin
|
||||
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
|
||||
mkdir -p $RUNNER_TEMP/bin
|
||||
mv kubectl $RUNNER_TEMP/bin
|
||||
echo "$RUNNER_TEMP/bin" >> $GITHUB_PATH
|
||||
|
||||
Reference in New Issue
Block a user