Prevent rate limiting by StatusCake (#5) #9
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: Push | |
on: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- '*.md' | |
- 'docs/' | |
- 'examples/' | |
- 'hack/' | |
- 'config/' | |
env: | |
DOCKER_FILE_PATH: Dockerfile | |
BUNDLE_DOCKER_FILE_PATH: bundle.Dockerfile | |
GOLANG_VERSION: 1.21 | |
OPERATOR_SDK_VERSION: "1.19.0" | |
KUSTOMIZE_VERSION: "4.5.7" | |
KUBERNETES_VERSION: "1.23.5" | |
KIND_VERSION: "v0.17.0" | |
HELM_REGISTRY_URL: "" | |
HELM_VERSION: v3.8.2 | |
REGISTRY: ghcr.io | |
jobs: | |
build: | |
name: Build | |
if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token | |
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GOLANG_VERSION }} | |
- name: Lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: v1.54 | |
only-new-issues: false | |
args: --timeout 10m | |
# Set up helm binary | |
- name: Set up Helm | |
uses: azure/setup-helm@v4 | |
with: | |
version: ${{ env.HELM_VERSION }} | |
- name: Helm Lint | |
run: | | |
helm lint charts/ingressmonitorcontroller | |
- name: Install kind | |
uses: engineerd/[email protected] | |
with: | |
version: ${{ env.KIND_VERSION }} | |
- name: Check cluster info | |
run: | | |
kubectl version --client | |
kind version | |
kind version | grep -q ${KIND_VERSION} | |
- name: Set up Cluster | |
run: | | |
kubectl cluster-info | |
make install | |
mkdir -p .local | |
echo "${{ secrets.SECRET_KUBERNETES_RESOURCES }}" | base64 --decode > .local/test-config.yaml | |
- name: Test | |
run: make test | |
- name: Generate Tag | |
id: generate_tag | |
uses: anothrNick/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
WITH_V: true | |
DEFAULT_BUMP: patch | |
DRY_RUN: true | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
buildkitd-flags: --debug | |
- name: Login to ghcr registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{env.REGISTRY}} | |
username: imc-user | |
password: ${{secrets.GITHUB_TOKEN}} | |
- name: Generate image repository path for ghcr registry | |
run: | | |
echo GHCR_IMAGE_REPOSITORY=${{env.REGISTRY}}/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV | |
- name: Build and Push image to ghcr registry | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ${{ env.DOCKER_FILE_PATH }} | |
pull: true | |
push: true | |
cache-to: type=inline | |
cache-from: type=gha | |
build-args: BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }} | |
platforms: linux/amd64 | |
tags: | | |
${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.new_tag }} | |
labels: | | |
org.opencontainers.image.source=${{ github.event.repository.clone_url }} | |
org.opencontainers.image.created=${{ steps.prep.outputs.created }} | |
org.opencontainers.image.revision=${{ github.sha }} |