refactor #67
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This GitHub Workflow will run on every push to the repository | |
# and will test the Kargo codebase on a Kind Kubernetes cluster. | |
name: CI - Kargo on Kind | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- "devcontainer/**" | |
- ".devcontainer/**" | |
- ".pulumi/**" | |
- ".talos/**" | |
- ".kube/**" | |
- "docs/**" | |
- "**.md" | |
pull_request: | |
branches: | |
- main | |
paths-ignore: | |
- "devcontainer/**" | |
- ".devcontainer/**" | |
- ".pulumi/**" | |
- ".talos/**" | |
- ".kube/**" | |
- "docs/**" | |
- "**.md" | |
schedule: | |
- cron: "0 2 * * *" | |
jobs: | |
ci-kargo-kind: | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/containercraft/konductor:latest | |
options: --user vscode --security-opt seccomp=unconfined | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
id: checkout | |
with: | |
fetch-depth: 1 | |
- name: Create Kind Cluster | |
id: create-kind-kubernetes | |
env: | |
ACTIONS_STEP_DEBUG: false | |
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
KUBEDIR: .kube | |
KUBECONFIG: .kube/config | |
run: | | |
direnv allow | |
mkdir -p ${KUBEDIR} && touch ${KUBECONFIG} && sudo chmod 600 ${HOME}/.kube/config | |
sudo chown -R $(whoami):$(whoami) $KUBECONFIG | |
sudo kind create cluster --retain --config=hack/kind.yaml --kubeconfig $KUBECONFIG | |
kubectl cluster-info --context kind-cilium --kubeconfig $KUBECONFIG | |
- id: pulumi-up | |
name: Deploy Pulumi IaC | |
env: | |
ACTIONS_STEP_DEBUG: false | |
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
KUBECONFIG: .kube/config | |
run: | | |
direnv allow | |
pulumi login | |
pulumi install | |
pulumi stack select --create dev | |
pulumi config set kubernetes kind | |
pulumi up --refresh --skip-preview | |
- id: pulumi-destroy | |
name: Wait for Kind Kubernetes API to be Ready | |
env: | |
ACTIONS_STEP_DEBUG: false | |
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
KUBECONFIG: .kube/config | |
run: | | |
pulumi down --skip-preview --refresh \ | |
|| PULUMI_K8S_DELETE_UNREACHABLE=true pulumi down --skip-preview --refresh | |
- name: Cleanup | |
id: clean-all | |
if: always() | |
run: | | |
direnv allow | |
make clean-all | |
env: | |
ACTIONS_STEP_DEBUG: false | |
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |