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

ci: add GitHub Workflow for building and pushing container-images #21

Merged
merged 2 commits into from
Dec 22, 2021
Merged
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
68 changes: 68 additions & 0 deletions .github/workflows/build-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
name: Publish container images in quay.io

on:
push:
branches:
- main

jobs:
push_controller:
name: Push controller container image to quay.io
if: github.repository == 'csi-addons/kubernetes-csi-addons'
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to quay.io
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}

- name: Build and push controller container image
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/arm/v7
push: true
tags: quay.io/csi-addons/k8s-controller:latest

push_sidecar:
name: Push sidecar container image to quay.io
if: github.repository == 'csi-addons/kubernetes-csi-addons'
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to quay.io
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}

- name: Build and push sidecar container image
uses: docker/build-push-action@v2
with:
context: .
file: build/Containerfile.sidecar
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/arm/v7
push: true
tags: quay.io/csi-addons/k8s-sidecar:latest
52 changes: 52 additions & 0 deletions .github/workflows/test-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
name: Test building container images

on:
pull_request:
branches:
- "*"

jobs:
build_controller:
name: Build controller container image
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build container container image
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/arm/v7
push: false
tags: quay.io/csi-addons/k8s-controller:latest

build_sidecar:
name: Test sidecar container image
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build sidecar container image
uses: docker/build-push-action@v2
with:
context: .
file: build/Containerfile.sidecar
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/arm/v7
push: false
tags: quay.io/csi-addons/k8s-sidecar:latest