summaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
authorAustin S. Hemmelgarn <austin@netdata.cloud>2021-01-15 09:45:05 -0500
committerGitHub <noreply@github.com>2021-01-15 09:45:05 -0500
commit7ffe03690b02ec9961837f09f3c225172fb31fad (patch)
tree1222fb85762f817af74683a2c0327bc3ab77f010 /.github
parent5a898b28c9a82ad39d5442568b71a8306f6d2ae9 (diff)
Switch to using GitHub Actions for publishing Docker images. (#10365)
* Switch to using GitHub Actions for publishing Docker images. This simplifies handling of multiarch images and publishing to multiple registries, and unifies testing with the code actually being used to build and publish the images. This also removes a handful of scripts that are no longer needed due to this change, and switches our Dockerfile to not needing an architecture to be specified in a build argument, instead relying on proper multiarch docker image support. * Fix YAML syntax. * Add separate tagging for nightly and stable builds. * Correct YAML syntax errors.
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/docker.yml50
1 files changed, 30 insertions, 20 deletions
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
index 447213554a..8f0795d1c0 100644
--- a/.github/workflows/docker.yml
+++ b/.github/workflows/docker.yml
@@ -13,37 +13,47 @@ on:
- '.github/workflows/docker.yml'
- 'netdata-installer.sh'
- 'packaging/**'
+ workflow_dispatch:
+ inputs:
+ version:
+ name: Version Tag
+ default: latest
+ required: true
jobs:
docker-build:
name: Docker Build
- strategy:
- matrix:
- arch:
- - linux/amd64
- - linux/i386
- - linux/arm/v7
- - linux/arm64
- include:
- - arch: linux/amd64
- base: amd64
- - arch: linux/i386
- base: i386
- - arch: linux/arm/v7
- base: armhf
- - arch: linux/arm64
- base: aarch64
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
+ - name: Determine if we should push changes and which tags to use
+ if: github.event_name == 'workflow_dispatch' && github.event.inputs.version != 'nightly'
+ run: |
+ echo "publish=true" >> $GITHUB_ENV
+ echo "tags=netdata/netdata:latest,netdata/netdata:stable,netdata/netdata:${{ github.event.inputs.version }}" >> $GITHUB_ENV
+ - name: Determine if we should push changes and which tags to use
+ if: github.event_name == 'workflow_dispatch' && github.event.inputs.version == 'nightly'
+ run: |
+ echo "publish=true" >> $GITHUB_ENV
+ echo "tags=netdata/netdata:latest,netdata/netdata:edge" >> $GITHUB_ENV
+ - name: Determine if we should push changes and which tags to use
+ if: github.event_name != 'workflow_dispatch'
+ run: |
+ echo "publish=false" >> $GITHUB_ENV
+ echo "tags=netdata/netdata:test" >> $GITHUB_ENV
- name: Setup QEMU
uses: docker/setup-qemu-action@v1
- name: Setup Buildx
uses: docker/setup-buildx-action@v1
+ - name: Docker Hub Login
+ if: github.event_name == 'workflow_dispatch'
+ uses: docker/login-action@v1
+ with:
+ username: ${{ secrets.DOCKER_HUB_USERNAME }}
+ password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Docker Build
uses: docker/build-push-action@v2
with:
- platforms: ${{ matrix.arch }}
- push: false
- build-args: |
- ARCH=${{ matrix.base }}
+ platforms: linux/amd64,linux/i386,linux/arm/v7,linux/arm64
+ push: ${{ env.publish }}
+ tags: ${{ env.tags }}