Skip to content

Commit

Permalink
Merge pull request #2 from ikifar2012/2021-03-23
Browse files Browse the repository at this point in the history
Docker Build
  • Loading branch information
SirGoodenough authored Aug 12, 2021
2 parents 5e42455 + 676a46c commit 9fca3b9
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: docker-build
on: [push, pull_request]
jobs:
build-image:
runs-on: ubuntu-latest
steps:
- name: Build Docker Image
uses: actions/checkout@v2
- run: docker build . -t latest
41 changes: 41 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Create and publish a Docker image

on:
release:
types: [published]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
14 changes: 14 additions & 0 deletions docker-compose-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3.3'
services:
tasmota-device-manager:
build: .
volumes:
- "/dockervolumes/tasmota-device-manager/config:/config"
- "/etc/localtime:/etc/localtime:ro"
- "/etc/timezone:/etc/timezone:ro"
ports:
- '5810:5800'
- '5910:5900'
container_name: tasmota-device-manager
hostname: tasmota-device-manager
restart: unless-stopped
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.3'
services:
tasmota-device-manager:
build: .
image: ghcr.io/sirgoodenough/tdmdock:latest
volumes:
- "/dockervolumes/tasmota-device-manager/config:/config"
- "/etc/localtime:/etc/localtime:ro"
Expand Down

0 comments on commit 9fca3b9

Please sign in to comment.