Skip to content

Commit

Permalink
ci: add kind testing
Browse files Browse the repository at this point in the history
  • Loading branch information
pandatix committed Jan 26, 2025
1 parent ece85ed commit 050f93a
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/kind.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Create Cluster with Registry

on:
push: {}

jobs:
setup-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Docker registry
run: |
docker network create kind || true
docker run -d --network kind --name registry -p 5000:5000 registry:2
- name: Set up Kind cluster
uses: helm/kind-action@v1.7.0
with:
version: v0.20.0
env:
KIND_EXPERIMENTAL_DOCKER_NETWORK: kind

- name: Connect Kind to the Docker registry
run: |
cat <<EOF > kind-config.yaml
apiVersion: kind.x-k8s.io/v1alpha4
kind: Cluster
containerdConfigPatches:
- |
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."localhost:5000"]
endpoint = ["http://registry:5000"]
EOF
kind create cluster --config kind-config.yaml
- name: Build and push CM
run: |
docker build \
-t localhost:5000/ctferio/chall-manager:${{ github.sha }} \
-f Dockerfile.chall-manager \
.
docker push localhost:5000/ctferio/chall-manager:${{ github.sha }}
- name: Build and push CM
run: |
docker build \
-t localhost:5000/ctferio/chall-manager-janitor:${{ github.sha }} \
-f Dockerfile.chall-manager-janitor \
.
docker push localhost:5000/ctferio/chall-manager-janitor:${{ github.sha }}
- name: Install Pulumi
uses: pulumi/actions@v4

- name: Configure stack
run: |
pulumi login --local
export PULUMI_CONFIG_PASSPHRASE=""
cd deploy
pulumi stack init dev
pulumi config set private-registry "localhost:5000/"
pulumi config set tag ${{ github.sha }}
pulumi up -y
pulumi stack output

0 comments on commit 050f93a

Please sign in to comment.