NightlyBuild #763
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: NightlyBuild | |
on: | |
schedule: | |
# This is a UTC time | |
- cron: "0 16 * * *" | |
# Keep it only for test purpose, comment it once everything is ok | |
workflow_dispatch: | |
jobs: | |
check: | |
runs-on: ubuntu-20.04 | |
outputs: | |
status: ${{ steps.early.outputs.status}} | |
steps: | |
- name: Early exit | |
id: early | |
run: | | |
if [ "${{ secrets.GHCR_TOKEN }}" != "" ] | |
then | |
echo "::set-output name=status::success" | |
else | |
echo "::set-output name=status::fail" | |
fi | |
BuildController: | |
needs: | |
- check | |
if: needs.check.outputs.status == 'success' | |
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/devops-controller | |
ghcr.io/kubesphere-sigs/devops-controller | |
tags: | | |
type=schedule,pattern=nightly-{{date 'YYYYMMDD'}} | |
type=raw,enable=true,value=nightly-{{date 'YYYYMMDD'}} | |
- name: Docker meta for Contributors | |
id: metaContributors | |
if: github.repository_owner != 'kubesphere' | |
uses: docker/metadata-action@v3 | |
with: | |
images: | | |
ghcr.io/${{ github.repository_owner }}/devops-controller | |
tags: | | |
type=schedule,pattern=nightly-{{date 'YYYYMMDD'}} | |
type=raw,enable=true,value=nightly-{{date 'YYYYMMDD'}} | |
- 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.repository_owner == 'kubesphere' | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USER }} | |
password: ${{ secrets.DOCKER_HUB_SECRETS }} | |
- name: Login to GHCR | |
if: github.repository_owner == 'kubesphere' | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: kubesphere-sigs | |
password: ${{ secrets.GHCR_TOKEN }} | |
- name: login to GHCR for Contributors | |
if: github.repository_owner != 'kubesphere' | |
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: | |
file: config/dockerfiles/controller-manager/Dockerfile | |
tags: ${{ steps.meta.outputs.tags }} | |
push: true | |
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: | |
file: config/dockerfiles/controller-manager/Dockerfile | |
tags: ${{ steps.metaContributors.outputs.tags }} | |
push: true | |
labels: ${{ steps.metaContributors.outputs.labels }} | |
platforms: linux/amd64,linux/arm64 | |
BuildAPIServer: | |
needs: | |
- check | |
if: needs.check.outputs.status == 'success' | |
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/devops-apiserver | |
ghcr.io/kubesphere-sigs/devops-apiserver | |
tags: | | |
type=schedule,pattern=nightly-{{date 'YYYYMMDD'}} | |
type=raw,enable=true,value=nightly-{{date 'YYYYMMDD'}} | |
- name: Docker meta for Contributors | |
id: metaContributors | |
if: github.repository_owner != 'kubesphere' | |
uses: docker/metadata-action@v3 | |
with: | |
images: | | |
ghcr.io/${{ github.repository_owner }}/devops-apiserver | |
tags: | | |
type=schedule,pattern=nightly-{{date 'YYYYMMDD'}} | |
type=raw,enable=true,value=nightly-{{date 'YYYYMMDD'}} | |
- 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.repository_owner == 'kubesphere' | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USER }} | |
password: ${{ secrets.DOCKER_HUB_SECRETS }} | |
- name: Login to GHCR | |
if: github.repository_owner == 'kubesphere' | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: kubesphere-sigs | |
password: ${{ secrets.GHCR_TOKEN }} | |
- name: login to GHCR for Contributors | |
if: github.repository_owner != 'kubesphere' | |
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: | |
file: config/dockerfiles/apiserver/Dockerfile | |
tags: ${{ steps.meta.outputs.tags }} | |
push: true | |
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: | |
file: config/dockerfiles/apiserver/Dockerfile | |
tags: ${{ steps.metaContributors.outputs.tags }} | |
push: true | |
labels: ${{ steps.metaContributors.outputs.labels }} | |
platforms: linux/amd64,linux/arm64 | |
BuildTools: | |
needs: | |
- check | |
if: needs.check.outputs.status == 'success' | |
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/devops-tools | |
ghcr.io/kubesphere-sigs/devops-tools | |
tags: | | |
type=schedule,pattern=nightly-{{date 'YYYYMMDD'}} | |
type=raw,enable=true,value=nightly-{{date 'YYYYMMDD'}} | |
- name: Docker meta for Contributors | |
id: metaContributors | |
if: github.repository_owner != 'kubesphere' | |
uses: docker/metadata-action@v3 | |
with: | |
images: | | |
ghcr.io/${{ github.repository_owner }}/devops-tools | |
tags: | | |
type=schedule,pattern=nightly-{{date 'YYYYMMDD'}} | |
type=raw,enable=true,value=nightly-{{date 'YYYYMMDD'}} | |
- 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.repository_owner == 'kubesphere' | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USER }} | |
password: ${{ secrets.DOCKER_HUB_SECRETS }} | |
- name: Login to GHCR | |
if: github.repository_owner == 'kubesphere' | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: kubesphere-sigs | |
password: ${{ secrets.GHCR_TOKEN }} | |
- name: login to GHCR for Contributors | |
if: github.repository_owner != 'kubesphere' | |
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: | |
file: config/dockerfiles/tools/Dockerfile | |
tags: ${{ steps.meta.outputs.tags }} | |
push: true | |
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: | |
file: config/dockerfiles/tools/Dockerfile | |
tags: ${{ steps.metaContributors.outputs.tags }} | |
push: true | |
labels: ${{ steps.metaContributors.outputs.labels }} | |
platforms: linux/amd64,linux/arm64 |