Skip to content

ci: update WELCOME-NEW-USERS workflow from global .github repo #110

ci: update WELCOME-NEW-USERS workflow from global .github repo

ci: update WELCOME-NEW-USERS workflow from global .github repo #110

Workflow file for this run

name: build-verify-package
on:
push:
paths-ignore:
#- '.github/**'
- '.gitignore'
- 'LICENSE'
- '*.md'
jobs:
build-verify-package:
runs-on: ubuntu-latest
environment: Build
steps:
- name: Get current date
id: date
#run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H:%M:%S')"
run: echo "date=$(date +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
- name: Checkout Code
uses: actions/checkout@v4
- name: Package container image for operator e2e tests
run: |
docker build -f build/Dockerfile -t quay.io/microcks/microcks-ansible-operator:e2e-tests .
echo ${{ secrets.QUAY_PASSWORD }} | docker login -u ${{ secrets.QUAY_USERNAME }} --password-stdin quay.io
docker push quay.io/microcks/microcks-ansible-operator:e2e-tests
- name: Install kubectl and Kind Cluster
run: |
set -x
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl \
&& sudo mv ./kubectl /usr/local/bin/kubectl \
&& sudo chmod +x /usr/local/bin/kubectl
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.11.1/kind-linux-amd64 \
&& sudo mv ./kind /usr/local/bin/kind \
&& sudo chmod +x /usr/local/bin/kind
- name: Run e2e tests on operator using Kuttl.dev
run: |
set -x
curl -Lo ./kuttl https://github.com/kudobuilder/kuttl/releases/download/v0.11.1/kubectl-kuttl_0.11.1_linux_x86_64 \
&& sudo cp kuttl /usr/local/bin/kubectl-kuttl \
&& sudo chmod +x /usr/local/bin/kubectl-kuttl
kubectl kuttl test --config=./tests/kuttl-test.yaml
- name: Set environment for branch
run: |
set -x
if [[ $GITHUB_REF == 'refs/heads/master' ]]; then
echo "IMAGE_TAG=nightly" >> "$GITHUB_ENV"
elif [[ $GITHUB_REF == "refs/tags/$GITHUB_REF_NAME" ]]; then
echo "IMAGE_TAG=$GITHUB_REF_NAME" >> "$GITHUB_ENV"
fi
- name: Set up QEMU
if: github.repository_owner == 'microcks'
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
if: github.repository_owner == 'microcks'
uses: docker/setup-buildx-action@v3
- name: Login to Quay.io Registry and setup multi-arch builder
if: github.repository_owner == 'microcks'
run: |
echo ${{ secrets.QUAY_PASSWORD }} | docker login -u ${{ secrets.QUAY_USERNAME }} --password-stdin quay.io
BUILDER=buildx-multi-arch
docker buildx inspect $BUILDER || docker buildx create --name=$BUILDER --driver=docker-container --driver-opt=network=host
- name: Build and push container image for webapp
if: github.repository_owner == 'microcks'
run: |
docker buildx build --push \
--platform=linux/amd64,linux/arm64 \
--builder=buildx-multi-arch \
--provenance=false \
--build-arg TAG=$IMAGE_TAG \
--file build/Dockerfile \
--label "org.opencontainers.image.revision=${GITHUB_SHA}" \
--label "org.opencontainers.image.created=${{ steps.date.outputs.date }}" \
--tag=quay.io/microcks/microcks-ansible-operator:$IMAGE_TAG .