ci: add kind testing #4
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
name: Create Cluster with Registry | |
on: [push, pull_request] | |
jobs: | |
kind-testing: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Kubernetes KinD Cluster | |
id: kind | |
uses: helm/kind-action@v1 | |
with: | |
registry: true | |
registry_name: ci-registry | |
registry_port: 5000 | |
registry_enable_delete: true | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0 | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1 | |
with: | |
images: ${{ steps.kind.outputs.LOCAL_REGISTRY }}/ctferio/chall-manager-janitor | |
- name: Git commit date | |
id: infos | |
run: | | |
# output date per RFC 3339 | |
date="$(git log -1 --format=%cd --date=format:%Y-%m-%dT%H:%M:%SZ)" | |
echo "date=$date" >> "$GITHUB_OUTPUT" | |
- name: Build and push Docker image | |
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc # v6.11.0 | |
id: build | |
with: | |
push: true | |
tags: ${{ github.sha }} | |
labels: ${{ steps.meta.outputs.labels }} | |
file: Dockerfile.chall-manager-janitor | |
build-args: | | |
VERSION=${{ github.sha }} | |
COMMIT=${{ github.sha }} | |
DATE=${{ steps.infos.outputs.date }} |