diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 0000000..ef95120 --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..9bb316c --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -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 }} \ No newline at end of file diff --git a/docker-compose-build.yml b/docker-compose-build.yml new file mode 100644 index 0000000..192afc8 --- /dev/null +++ b/docker-compose-build.yml @@ -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 diff --git a/docker-compose.yml b/docker-compose.yml index 192afc8..e4d71ca 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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"