Skip to content

[deps]: Update docker/setup-buildx-action digest to c47758b (#67) #46

[deps]: Update docker/setup-buildx-action digest to c47758b (#67)

[deps]: Update docker/setup-buildx-action digest to c47758b (#67) #46

Workflow file for this run

---
name: Build for GitHub Container Registry
on:
push:
branches:
- "main"
workflow_dispatch:
jobs:
build-docker:
name: Build Docker images
runs-on: ubuntu-22.04
env:
_GHCR_REGISTRY: ghcr.io/bitwarden
_PROJECT_NAME: sm-operator
steps:
- name: Check out repo
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: Test operator
id: test
run: |
sudo apt update && sudo apt install musl-tools -y
make setup
make test
- name: Upload to codecov.io
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Generate Docker image tag
id: tag
run: |
IMAGE_TAG=$(echo "${GITHUB_REF:11}" | sed "s#/#-#g") # slash safe branch name
if [[ "$IMAGE_TAG" == "main" ]]; then
IMAGE_TAG=dev
fi
echo "image_tag=$IMAGE_TAG" >> $GITHUB_OUTPUT
- name: Generate image full name
id: image-name
env:
IMAGE_TAG: ${{ steps.tag.outputs.image_tag }}
run: echo "name=${_GHCR_REGISTRY}/${_PROJECT_NAME}:${IMAGE_TAG}" >> $GITHUB_OUTPUT
- name: Build Docker image
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
with:
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.image-name.outputs.name }}
- name: Create kind cluster
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
- name: Smoke test image
id: smoke-test
env:
IMAGE: ${{ steps.image-name.outputs.name }}
run: |
make deploy IMG=$IMAGE
count=0
while [[ $(kubectl get pods -n sm-operator-system -l control-plane=controller-manager -o jsonpath="{.items[*].status.containerStatuses[*].ready}") != "true" ]]; do
sleep 1;
count=$count+1
if [[ count -ge 30 ]]; then
break
fi
done
#For review purposes
echo "*****DEPLOYMENTS*****"
kubectl get deployments -n sm-operator-system
echo "*****PODS*****"
pods=$(kubectl get pods -n sm-operator-system -l control-plane=controller-manager | grep 2/2)
echo $pods
if [[ -z "$pods" ]]; then
echo "::error::No pods found."
exit 1
fi
echo "*****OPERATOR OK*****"
- name: Clean up
run: |
make undeploy
kind delete cluster