Enable build workflow
This commit is contained in:
parent
6e400a70ed
commit
b2b235f6a5
|
|
@ -0,0 +1,25 @@
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
paths-ignore:
|
||||||
|
- 'runner/**'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Build
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Install kubebuilder
|
||||||
|
run: |
|
||||||
|
curl -L -O https://github.com/kubernetes-sigs/kubebuilder/releases/download/v2.2.0/kubebuilder_2.2.0_linux_amd64.tar.gz
|
||||||
|
tar zxvf kubebuilder_2.2.0_linux_amd64.tar.gz
|
||||||
|
sudo mv kubebuilder_2.2.0_linux_amd64 /usr/local/kubebuilder
|
||||||
|
- name: Build container image
|
||||||
|
run: make docker-build
|
||||||
|
- name: Docker Login
|
||||||
|
run: docker login -u summerwind -p ${{ secrets.DOCKER_ACCESS_TOKEN }}
|
||||||
|
- name: Push container image
|
||||||
|
run: make docker-push
|
||||||
10
Makefile
10
Makefile
|
|
@ -1,6 +1,6 @@
|
||||||
|
NAME ?= summerwind/actions-runner-controller
|
||||||
|
VERSION ?= latest
|
||||||
|
|
||||||
# Image URL to use all building/pushing image targets
|
|
||||||
IMG ?= summerwind/actions-runner-controller:latest
|
|
||||||
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
|
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
|
||||||
CRD_OPTIONS ?= "crd:trivialVersions=true"
|
CRD_OPTIONS ?= "crd:trivialVersions=true"
|
||||||
|
|
||||||
|
|
@ -35,7 +35,7 @@ uninstall: manifests
|
||||||
|
|
||||||
# Deploy controller in the configured Kubernetes cluster in ~/.kube/config
|
# Deploy controller in the configured Kubernetes cluster in ~/.kube/config
|
||||||
deploy: manifests
|
deploy: manifests
|
||||||
cd config/manager && kustomize edit set image controller=${IMG}
|
cd config/manager && kustomize edit set image controller=${NAME}:${VERSION}
|
||||||
kustomize build config/default | kubectl apply -f -
|
kustomize build config/default | kubectl apply -f -
|
||||||
|
|
||||||
# Generate manifests e.g. CRD, RBAC etc.
|
# Generate manifests e.g. CRD, RBAC etc.
|
||||||
|
|
@ -56,11 +56,11 @@ generate: controller-gen
|
||||||
|
|
||||||
# Build the docker image
|
# Build the docker image
|
||||||
docker-build: test
|
docker-build: test
|
||||||
docker build . -t ${IMG}
|
docker build . -t ${NAME}:${VERSION}
|
||||||
|
|
||||||
# Push the docker image
|
# Push the docker image
|
||||||
docker-push:
|
docker-push:
|
||||||
docker push ${IMG}
|
docker push ${NAME}:${VERSION}
|
||||||
|
|
||||||
# find or download controller-gen
|
# find or download controller-gen
|
||||||
# download controller-gen if necessary
|
# download controller-gen if necessary
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue