Base Builder #1701
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
--- | |
# Builds our base and builder Docker iamges that it used to build the Production Docker Image(s) | |
name: Base Builder | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
push: | |
branches: | |
- 'master' | |
pull_request: | |
concurrency: | |
group: base-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-check: | |
name: Build Check | |
if: github.event_name == 'pull_request' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
image: | |
- base | |
- builder | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Test Build | |
uses: docker/build-push-action@v4 | |
with: | |
load: false | |
push: false | |
tags: netdata/${{ matrix.image }}:test | |
file: ./${{ matrix.image }}/Dockerfile | |
pr-checks: | |
name: PR Checks | |
if: github.event_name == 'pull_request' | |
needs: build-check | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
image: | |
- base | |
- builder | |
platforms: | |
- linux/i386 | |
- linux/arm/v7 | |
- linux/arm64/v8 | |
- linux/ppc64le | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup QEMU | |
if: matrix.platforms != 'linux/i386' | |
uses: docker/setup-qemu-action@v2 | |
- name: Setup Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build | |
uses: docker/build-push-action@v4 | |
with: | |
platforms: ${{ matrix.platforms }} | |
load: false | |
push: false | |
tags: netdata/${{ matrix.image }}:test | |
file: ./${{ matrix.image }}/Dockerfile | |
publish: | |
name: Publish Images | |
if: github.event_name == 'push' || (github.event_name == 'schedule' && github.repository == 'netdata/helper-images') | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
image: | |
- base | |
- builder | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Setup Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Docker Hub Login | |
uses: docker/login-action@v2 | |
with: | |
username: netdatabot | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: GitHub Container Registry Login | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Quay.io Login | |
uses: docker/login-action@v2 | |
with: | |
registry: quay.io | |
username: ${{ secrets.NETDATABOT_QUAY_USERNAME }} | |
password: ${{ secrets.NETDATABOT_QUAY_TOKEN }} | |
- name: Quay.io Login | |
uses: docker/login-action@v2 | |
with: | |
registry: quay.io | |
username: ${{ secrets.NETDATABOT_QUAY_USERNAME }} | |
password: ${{ secrets.NETDATABOT_QUAY_TOKEN }} | |
- name: Docker Build | |
uses: docker/build-push-action@v4 | |
with: | |
platforms: linux/amd64,linux/i386,linux/arm/v7,linux/arm64,linux/ppc64le | |
push: true | |
file: ./${{ matrix.image }}/Dockerfile | |
tags: netdata/${{ matrix.image }}:latest,ghcr.io/netdata/${{ matrix.image }}:latest,quay.io/netdata/${{ matrix.image }}:latest |