Skip to content

Build Images

Build Images #1

Workflow file for this run

name: Build Images
on:
push:
branches:
- master
- test-* # make it be easier for contributors to test
tags:
- 'v*.*.*'
pull_request:
branches:
- 'master'
jobs:
BuildBase:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Docker meta for KubeSphere
id: meta
if: github.repository_owner == 'kubesphere'
uses: docker/metadata-action@v3
with:
images: |
kubespheredev/builder-base
ghcr.io/${{ github.repository_owner }}/builder-base
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
type=sha
- name: Docker meta for Contributors
id: metaContributors
if: github.repository_owner != 'kubesphere'
uses: docker/metadata-action@v3
with:
images: |
ghcr.io/${{ github.repository_owner }}/builder-base
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_SECRETS }}
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Build and push Docker images
uses: docker/[email protected]
if: github.repository_owner == 'kubesphere'
with:
context: base
file: base/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
push: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
- name: Build and push Docker images for Contributors
uses: docker/[email protected]
if: github.repository_owner != 'kubesphere'
with:
context: base
file: base/Dockerfile
tags: ${{ steps.metaContributors.outputs.tags }}
push: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.metaContributors.outputs.labels }}
platforms: linux/amd64,linux/arm64
BuildGo:
needs: BuildBase
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Docker meta for KubeSphere
id: meta
if: github.repository_owner == 'kubesphere'
uses: docker/metadata-action@v3
with:
images: |
kubespheredev/builder-go
ghcr.io/${{ github.repository_owner }}/builder-go
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
type=sha
- name: Docker meta for Contributors
id: metaContributors
if: github.repository_owner != 'kubesphere'
uses: docker/metadata-action@v3
with:
images: |
ghcr.io/${{ github.repository_owner }}/builder-go
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_SECRETS }}
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Build and push Docker images
uses: docker/[email protected]
if: github.repository_owner == 'kubesphere'
with:
context: go
file: go/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
push: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
build-args: "GOLANG_VERSION=1.12.10"
- name: Build and push Docker images for Contributors
uses: docker/[email protected]
if: github.repository_owner != 'kubesphere'
with:
context: go
file: go/Dockerfile
tags: ${{ steps.metaContributors.outputs.tags }}
push: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.metaContributors.outputs.labels }}
platforms: linux/amd64,linux/arm64
build-args: "GOLANG_VERSION=1.12.10"
BuildGo16:
needs: BuildBase
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Docker meta for KubeSphere
id: meta
if: github.repository_owner == 'kubesphere'
uses: docker/metadata-action@v3
with:
images: |
kubespheredev/builder-go
ghcr.io/${{ github.repository_owner }}/builder-go
tags: |
type=ref,event=branch,suffix=1.16
type=ref,event=pr,suffix=1.16
type=semver,pattern=v{{version}},suffix=1.16
- name: Docker meta for Contributors
id: metaContributors
if: github.repository_owner != 'kubesphere'
uses: docker/metadata-action@v3
with:
images: |
ghcr.io/${{ github.repository_owner }}/builder-go
tags: |
type=ref,event=branch,suffix=1.16
type=ref,event=pr,suffix=1.16
type=semver,pattern=v{{version}},suffix=1.16
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_SECRETS }}
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Build and push Docker images
uses: docker/[email protected]
if: github.repository_owner == 'kubesphere'
with:
context: go
file: go/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
push: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
build-args: "GOLANG_VERSION=1.16.8"
- name: Build and push Docker images for Contributors
uses: docker/[email protected]
if: github.repository_owner != 'kubesphere'
with:
context: go
file: go/Dockerfile
tags: ${{ steps.metaContributors.outputs.tags }}
push: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.metaContributors.outputs.labels }}
platforms: linux/amd64,linux/arm64
build-args: "GOLANG_VERSION=1.16.8"
BuildMaven:
needs: BuildBase
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Docker meta for KubeSphere
id: meta
if: github.repository_owner == 'kubesphere'
uses: docker/metadata-action@v3
with:
images: |
kubespheredev/builder-maven
ghcr.io/${{ github.repository_owner }}/builder-maven
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
type=sha
- name: Docker meta for Contributors
id: metaContributors
if: github.repository_owner != 'kubesphere'
uses: docker/metadata-action@v3
with:
images: |
ghcr.io/${{ github.repository_owner }}/builder-maven
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_SECRETS }}
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Build and push Docker images
uses: docker/[email protected]
if: github.repository_owner == 'kubesphere'
with:
context: maven
file: maven/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
push: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
build-args: "JDK_VERSION=1.8.0"
- name: Build and push Docker images for Contributors
uses: docker/[email protected]
if: github.repository_owner != 'kubesphere'
with:
context: maven
file: maven/Dockerfile
tags: ${{ steps.metaContributors.outputs.tags }}
push: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.metaContributors.outputs.labels }}
platforms: linux/amd64,linux/arm64
build-args: "JDK_VERSION=1.8.0"
BuildMavenJDK11:
needs: BuildBase
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Docker meta for KubeSphere
id: meta
if: github.repository_owner == 'kubesphere'
uses: docker/metadata-action@v3
with:
images: |
kubespheredev/builder-maven
ghcr.io/${{ github.repository_owner }}/builder-maven
tags: |
type=ref,event=branch,suffix=jdk11
type=ref,event=pr,suffix=jdk11
type=semver,pattern=v{{version}},suffix=jdk11
- name: Docker meta for Contributors
id: metaContributors
if: github.repository_owner != 'kubesphere'
uses: docker/metadata-action@v3
with:
images: |
ghcr.io/${{ github.repository_owner }}/builder-maven
tags: |
type=ref,event=branch,suffix=jdk11
type=ref,event=pr,suffix=jdk11
type=semver,pattern=v{{version}},suffix=jdk11
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_SECRETS }}
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Build and push Docker images
uses: docker/[email protected]
if: github.repository_owner == 'kubesphere'
with:
context: maven
file: maven/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
push: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
build-args: "JDK_VERSION=11"
- name: Build and push Docker images for Contributors
uses: docker/[email protected]
if: github.repository_owner != 'kubesphere'
with:
context: maven
file: maven/Dockerfile
tags: ${{ steps.metaContributors.outputs.tags }}
push: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.metaContributors.outputs.labels }}
platforms: linux/amd64,linux/arm64
build-args: "JDK_VERSION=11"
BuildNodeJs:
needs: BuildBase
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Docker meta for KubeSphere
id: meta
if: github.repository_owner == 'kubesphere'
uses: docker/metadata-action@v3
with:
images: |
kubespheredev/builder-nodejs
ghcr.io/${{ github.repository_owner }}/builder-nodejs
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
type=sha
- name: Docker meta for Contributors
id: metaContributors
if: github.repository_owner != 'kubesphere'
uses: docker/metadata-action@v3
with:
images: |
ghcr.io/${{ github.repository_owner }}/builder-nodejs
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_SECRETS }}
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Build and push Docker images
uses: docker/[email protected]
if: github.repository_owner == 'kubesphere'
with:
context: nodejs
file: nodejs/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
push: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
- name: Build and push Docker images for Contributors
uses: docker/[email protected]
if: github.repository_owner != 'kubesphere'
with:
context: nodejs
file: nodejs/Dockerfile
tags: ${{ steps.metaContributors.outputs.tags }}
push: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.metaContributors.outputs.labels }}
platforms: linux/amd64,linux/arm64
BuildDotnet:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Docker meta for KubeSphere
id: meta
if: github.repository_owner == 'kubesphere'
uses: docker/metadata-action@v3
with:
images: |
kubespheredev/builder-dotnet
ghcr.io/${{ github.repository_owner }}/builder-dotnet
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
type=sha
- name: Docker meta for Contributors
id: metaContributors
if: github.repository_owner != 'kubesphere'
uses: docker/metadata-action@v3
with:
images: |
ghcr.io/${{ github.repository_owner }}/builder-dotnet
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_SECRETS }}
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Build and push Docker images
uses: docker/[email protected]
if: github.repository_owner == 'kubesphere'
with:
context: dotnet
file: dotnet/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
push: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
- name: Build and push Docker images for Contributors
uses: docker/[email protected]
if: github.repository_owner != 'kubesphere'
with:
context: dotnet
file: dotnet/Dockerfile
tags: ${{ steps.metaContributors.outputs.tags }}
push: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.metaContributors.outputs.labels }}
platforms: linux/amd64,linux/arm64
BuildPython:
needs: BuildBase
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Docker meta for KubeSphere
id: meta
if: github.repository_owner == 'kubesphere'
uses: docker/metadata-action@v3
with:
images: |
kubespheredev/builder-python
ghcr.io/${{ github.repository_owner }}/builder-python
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
type=sha
- name: Docker meta for Contributors
id: metaContributors
if: github.repository_owner != 'kubesphere'
uses: docker/metadata-action@v3
with:
images: |
ghcr.io/${{ github.repository_owner }}/builder-python
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_SECRETS }}
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Build and push Docker images
uses: docker/[email protected]
if: github.repository_owner == 'kubesphere'
with:
context: python
file: python/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
push: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
- name: Build and push Docker images for Contributors
uses: docker/[email protected]
if: github.repository_owner != 'kubesphere'
with:
context: python
file: python/Dockerfile
tags: ${{ steps.metaContributors.outputs.tags }}
push: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.metaContributors.outputs.labels }}
platforms: linux/amd64,linux/arm64