From bd9397b3937b5b1d37638c31024c0de611ca4abe Mon Sep 17 00:00:00 2001 From: Martin Holters Date: Mon, 15 May 2023 14:36:41 +0200 Subject: [PATCH 1/3] Add Github Actions workflow to build and publish Docker images --- .github/workflows/dockerimage.yml | 53 +++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/dockerimage.yml diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml new file mode 100644 index 0000000..2a80399 --- /dev/null +++ b/.github/workflows/dockerimage.yml @@ -0,0 +1,53 @@ +name: ci + +on: + push: + branches: + - "main" + tags: + - "*" + pull_request: + branches: + - "main" + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + # list of Docker images to use as base name for tags + images: | + ghcr.io/${{ github.repository }} + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Login to Docker Hub + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + platforms: linux/amd64,linux/386,linux/arm64,linux/arm + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} From 2e5198242838384c2ebc914c9a93f502f4dd3b7f Mon Sep 17 00:00:00 2001 From: Martin Holters Date: Mon, 15 May 2023 15:13:50 +0200 Subject: [PATCH 2/3] Build docker image with and without influxdb --- .github/workflows/dockerimage.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml index 2a80399..d3eefcb 100644 --- a/.github/workflows/dockerimage.yml +++ b/.github/workflows/dockerimage.yml @@ -16,6 +16,9 @@ jobs: permissions: contents: read packages: write + strategy: + matrix: + with_influxdb: ["no", "yes"] steps: - name: Checkout @@ -28,6 +31,8 @@ jobs: # list of Docker images to use as base name for tags images: | ghcr.io/${{ github.repository }} + flavor: | + suffix=${{ matrix.with_influxdb == 'yes' && '-with-influxdb' || '' }}, onlatest=true - name: Set up QEMU uses: docker/setup-qemu-action@v2 @@ -47,6 +52,8 @@ jobs: uses: docker/build-push-action@v4 with: context: . + build-args: | + with_influxdb=${{ matrix.with_influxdb }} platforms: linux/amd64,linux/386,linux/arm64,linux/arm push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} From e65d71eee602461cef119bcc56960252346bc714 Mon Sep 17 00:00:00 2001 From: Martin Holters Date: Mon, 15 May 2023 14:51:52 +0200 Subject: [PATCH 3/3] Enable dependabot for Github Actions --- .github/dependabot.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..90e05c4 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "github-actions" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly"