Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom action #1

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/pr-intility.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: PR Intility
on:
pull_request: {}

jobs:
lint:
if: github.repository == 'intility/olm-for-cilium' && github.event_name == 'pull_request'
name: Lint Image Build Logic
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- uses: docker://quay.io/cilium/image-maker:9e2e7ad1a524cf714d491945e90fe650125cd60a
name: Run make lint
with:
entrypoint: make
args: lint
set-version:
runs-on: ubuntu-20.04
needs: lint
outputs:
version: ${{ steps.set.outputs.VERSION }}
steps:
- id: set
name: Set Version
run: |
version=$(echo ${{ github.head_ref }} | rev | cut -d '/' -f 1 | rev)
if ! [[ $version =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then
version=nothing
fi
echo "VERSION=${version}" >> $GITHUB_OUTPUT
build-and-validate:
if: needs.set-version.outputs.version != 'nothing'
env:
PREFLIGHT_VERSION: 1.2.1
PFLT_DOCKERCONFIG: ~/.docker/config.json
VERSION: ${{ needs.set-version.outputs.version }}
name: Build Images and Validate Images
runs-on: ubuntu-20.04
needs: set-version
steps:
- uses: actions/checkout@v1
- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 #v3.0.0
- name: Login to Quay.io
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d #v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push to Quay.io
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 #v5.0.0
with:
provenance: false
context: ./operator/cilium.${{ env.VERSION }}/
push: true
tags: ghcr.io/intility/olm-for-cilium-ci:${{ env.VERSION }}-${{ github.event.pull_request.head.sha }}
49 changes: 49 additions & 0 deletions .github/workflows/publish-intility.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Publish Intility
on:
workflow_dispatch:
inputs:
version:
description: 'Define version to be built and tested (example: "1.13.4")'
required: true

jobs:
set-olm-tag:
runs-on: ubuntu-20.04
outputs:
olm-tag: ${{ steps.set.outputs.OLM_TAG }}
steps:
- uses: actions/checkout@v1
- id: set
name: Set OLM Tag
run: |
VERSION="${{ github.event.inputs.version }}"
set -o pipefail
olm_tag=$(yq .spec.install.spec.deployments[0].spec.template.spec.containers[0].image bundles/cilium.v${VERSION#v}/manifests/cilium.clusterserviceversion.yaml | cut -d ':' -f 2)
echo "::set-output name=OLM_TAG::${olm_tag}"
build-and-publish:
if: needs.set-olm-tag.outputs.olm-tag != ''
env:
PREFLIGHT_VERSION: 1.2.1
OLM_TAG: ${{ needs.set-olm-tag.outputs.olm-tag }}
name: Build Images and Validate Images
runs-on: ubuntu-20.04
needs: set-olm-tag
steps:
- uses: actions/checkout@v1
- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 #v3.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 #v3.0.0
- name: Login to ghcr
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d #v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push to Quay.io
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 #v5.0.0
with:
provenance: false
context: ./operator/cilium.v${{ github.event.inputs.version }}/
push: true
tags: ghcr.io/intility/olm-for-cilium:${{ env.OLM_TAG }}
Loading
Loading