diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..f7d5edf --- /dev/null +++ b/.github/workflows/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: ${{ 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: | + {{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}" \