From e6e84b6baa55bfbdade9b4838cf6a9636626176e Mon Sep 17 00:00:00 2001 From: Christian Moll Date: Mon, 26 Apr 2021 11:53:29 +0200 Subject: [PATCH 1/3] update to pio 5.1.1 and add a github workflow to build and push docker images to dockerhub --- .github/workflow/docker.yml | 44 +++++++++++++++++++++++++++++++++++++ Dockerfile | 2 +- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 .github/workflow/docker.yml diff --git a/.github/workflow/docker.yml b/.github/workflow/docker.yml new file mode 100644 index 0000000..960512d --- /dev/null +++ b/.github/workflow/docker.yml @@ -0,0 +1,44 @@ +name: 'Build and publish docker images (all platforms)' + +on: + push: + branches: + - '!*' + tags: + - '*' + pull_request: + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Docker meta + id: docker_meta + uses: crazy-max/ghaction-docker-meta@v1 + with: + images: lazyzero/docker-platformio-core # list of Docker images to use as base name for tags + tag-sha: false # add git short SHA as Docker tag, e.g.: sha-12affe0 + tag-latest: true # disabled here for demonstration purposes + tag-semver: | + {{major}}.{{minor}}.{{patch}} + - 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.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.docker_meta.outputs.tags }} + labels: ${{ steps.docker_meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index a1062b7..9f385cc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM python:3.9.0-slim -ENV APP_VERSION="5.1.0" \ +ENV APP_VERSION="5.1.1" \ APP="platformio-core" LABEL app.name="${APP}" \ From 8d999a5ac55dce158f246962ea72d89b42b1109c Mon Sep 17 00:00:00 2001 From: Christian Moll Date: Mon, 26 Apr 2021 11:57:49 +0200 Subject: [PATCH 2/3] correct workflows folder --- .github/{workflow => workflows}/docker.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{workflow => workflows}/docker.yml (100%) diff --git a/.github/workflow/docker.yml b/.github/workflows/docker.yml similarity index 100% rename from .github/workflow/docker.yml rename to .github/workflows/docker.yml From 41bee3b65c0f2f23d7324002db4d7edabb69d6fa Mon Sep 17 00:00:00 2001 From: Christian Moll Date: Mon, 26 Apr 2021 14:02:10 +0200 Subject: [PATCH 3/3] Update docker.yml replacing docker image name by secret to make it generic --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 960512d..f7d5edf 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -18,7 +18,7 @@ jobs: id: docker_meta uses: crazy-max/ghaction-docker-meta@v1 with: - images: lazyzero/docker-platformio-core # list of Docker images to use as base name for tags + images: ${{ secrets.DOCKERHUB_IMAGE }} # list of Docker images to use as base name for tags tag-sha: false # add git short SHA as Docker tag, e.g.: sha-12affe0 tag-latest: true # disabled here for demonstration purposes tag-semver: |