Skip to content

Possibly fix repo/workspace path? #4

Possibly fix repo/workspace path?

Possibly fix repo/workspace path? #4

Workflow file for this run

name: Run kubectl against remote cluster
on:
workflow_dispatch:
push:
branches:
- "1-github-runner-manages-remote"
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Install kubectl
run: |
mkdir $HOME/bin
curl -Lf "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" -o $HOME/bin/kubectl
chmod +x $HOME/bin/kubectl
echo "$HOME/bin" >> $GITHUB_PATH
- name: Check kubectl is available on PATH
run: kubectl version --client
- name: Checkout repo
uses: actions/checkout@v4
- name: Set kubeconfig with kubectl
run: |
kubectl config set-cluster "minikube" --server "${{ secrets.API_SERVER_ADDR }}"
kubectl config set-credentials "remote-dev" --token "${{ secrets.JWT_AUTH_TOKEN }}"
kubectl config set-context "remote-context" --cluster "minikube" --user "remote-dev"
kubectl config use-context "remote-context"
- name: Check kubectl has authenticated/authorized access to the remote API
run: kubectl get namespaces
- name: kubectl apply with a file
run: |
kubectl apply -f "${GITHUB_WORKSPACE}/manifests/nginx-test.yml"