From 668fca3b4501350eecc6378b2d236584d55834d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Drouet?= Date: Fri, 29 Nov 2019 19:53:03 +0100 Subject: [PATCH] Use github actions to autobuild docker image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Drouet --- .github/workflows/main.yml | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..1035e0b --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,39 @@ +name: build docker image + +on: [push] + +jobs: + build: + name: build images and push + runs-on: ubuntu-latest + + steps: + + - name: install qemu + run: docker run --rm --privileged hypriot/qemu-register + + - name: checkout + uses: actions/checkout@v1 + + - name: login to docker hub + run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin + + - name: install buildx + run: | + mkdir -vp ~/.docker/cli-plugins/ ~/dockercache + curl --silent -L "https://github.com/docker/buildx/releases/download/v0.3.0/buildx-v0.3.0.linux-amd64" > ~/.docker/cli-plugins/docker-buildx + chmod a+x ~/.docker/cli-plugins/docker-buildx + docker buildx create --use + + - name: build image and push to hub + if: github.ref == 'refs/heads/master' + run: | + docker buildx build --push \ + --platform linux/arm/v7,linux/arm64/v8 \ + -t $GITHUB_REPOSITORY:latest \ + . + + - name: build image + if: github.ref != 'refs/heads/master' + run: | + docker buildx build --platform linux/arm/v7,linux/arm64/v8 .