Skip to content

Commit

Permalink
Merge pull request #10 from Snuffy2/GitHub-Action-to-Create-GitHub-Co…
Browse files Browse the repository at this point in the history
…ntainer-Docker

GitHub Workflow to Create GitHub Container Docker
  • Loading branch information
snicker authored Nov 11, 2023
2 parents 639504a + f26c378 commit c0b9822
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 1 deletion.
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: "daily"
46 changes: 46 additions & 0 deletions .github/workflows/build_docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build and Publish GitHub Container Docker Image
on:
release:
types: [published, edited]
push:
branches:
- main
- master
workflow_dispatch:

jobs:
build_and_publish_docker_image:
if: github.repository_owner == 'snicker'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
flavor: |
latest=auto
tags: |
type=edge,branch=main
type=semver,pattern={{version}}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Docker Container
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64,linux/arm64,linux/arm/v7
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.12-bookworm
FROM python:3.12-slim-bookworm

ENV MQTT_HOST="127.0.0.1"
ENV MQTT_PORT=1883
Expand Down

0 comments on commit c0b9822

Please sign in to comment.