Skip to content

Commit

Permalink
Add Github Actions workflow to build and publish Docker images (#18)
Browse files Browse the repository at this point in the history
* Add Github Actions workflow to build and publish Docker images

* Build docker image with and without influxdb

* Enable dependabot for Github Actions
  • Loading branch information
martinholters committed May 15, 2023
1 parent adf1744 commit 2ebb438
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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"
60 changes: 60 additions & 0 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: ci

on:
push:
branches:
- "main"
tags:
- "*"
pull_request:
branches:
- "main"

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
with_influxdb: ["no", "yes"]
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 }}
flavor: |
suffix=${{ matrix.with_influxdb == 'yes' && '-with-influxdb' || '' }}, onlatest=true
-
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: .
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 }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 2ebb438

Please sign in to comment.