From 6a527c4fda8eb0e48d591bd2707abae2170f7446 Mon Sep 17 00:00:00 2001 From: Sameer Dhoot Date: Thu, 20 Jul 2023 17:15:21 -0400 Subject: [PATCH 01/13] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 64ce66d..a018880 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,6 +23,6 @@ jobs: uses: macbre/push-to-ghcr@v9 with: image_name: ${{ github.repository }} - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ secrets.REPO_WOLWEB_CI }} dockerfile: Dockerfile image_tag: latest From bbc47631ac32ad54d6657de4a1b63d11ca003c85 Mon Sep 17 00:00:00 2001 From: Sameer Dhoot Date: Thu, 20 Jul 2023 17:17:04 -0400 Subject: [PATCH 02/13] Update release.yml --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a018880..fd8c541 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,8 @@ on: push: tags: - '*' + branches: + - main jobs: release: From 3915b3bc0dcf17ccb3da3a3daf74599a453b2443 Mon Sep 17 00:00:00 2001 From: Sameer Dhoot Date: Thu, 20 Jul 2023 17:17:53 -0400 Subject: [PATCH 03/13] Update release.yml --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fd8c541..be74dcb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,6 +7,7 @@ on: - '*' branches: - main + - sameerdhoot-patch-1 jobs: release: From 13b9e478e57d3daa28ee979696a197c498fd6545 Mon Sep 17 00:00:00 2001 From: Sameer Dhoot Date: Thu, 20 Jul 2023 17:33:39 -0400 Subject: [PATCH 04/13] Update release.yml --- .github/workflows/release.yml | 50 ++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index be74dcb..2b289fe 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,31 +1,45 @@ ---- -name: Release +name: Build Docker Containers on: push: - tags: - - '*' branches: - main - - sameerdhoot-patch-1 + paths-ignore: + - "README.md" + - "LICENSE" + - ".gitignore" + workflow_dispatch: jobs: - release: + build-alpine: + permissions: write-all runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 - - name: Build and publish the container image for ${{ github.repository }}:${{ github.ref_name }} - uses: macbre/push-to-ghcr@v9 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Container Registry + uses: docker/login-action@v2 with: - image_name: ${{ github.repository }} - github_token: ${{ secrets.GITHUB_TOKEN }} - dockerfile: Dockerfile - image_tag: ${{ github.ref_name }} - - name: Build and publish the container image for ${{ github.repository }}:latest - uses: macbre/push-to-ghcr@v9 + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.REPO_WOLWEB_CI }} + + - name: Build and Push Alpine Dockerfile + id: docker_build + uses: docker/build-push-action@v3.2.0 with: - image_name: ${{ github.repository }} - github_token: ${{ secrets.REPO_WOLWEB_CI }} - dockerfile: Dockerfile - image_tag: latest + platforms: linux/arm64,linux/armhf,linux/386,linux/amd64 + push: true + tags: | + ghcr.io/${{ github.repository }}:latest + ghcr.io/${{ github.repository }}:alpine + pull: false + context: . + file: Dockerfile From 3ac223f705dd4b1ca8907b554787bee05346eccb Mon Sep 17 00:00:00 2001 From: Sameer Dhoot Date: Thu, 20 Jul 2023 17:34:49 -0400 Subject: [PATCH 05/13] Update release.yml --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2b289fe..4bbba77 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - sameerdhoot-patch-1 paths-ignore: - "README.md" - "LICENSE" From 96c2d619456bc7030cd24014c6a521400da46530 Mon Sep 17 00:00:00 2001 From: Sameer Dhoot Date: Thu, 20 Jul 2023 17:50:41 -0400 Subject: [PATCH 06/13] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4bbba77..e0b8b86 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,7 +30,7 @@ jobs: with: registry: ghcr.io username: ${{ github.actor }} - password: ${{ secrets.REPO_WOLWEB_CI }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build and Push Alpine Dockerfile id: docker_build From af1bdacbbd5ea97476836c8899a07171ecbc5af6 Mon Sep 17 00:00:00 2001 From: Sameer Dhoot Date: Thu, 20 Jul 2023 18:26:51 -0400 Subject: [PATCH 07/13] Update release.yml --- .github/workflows/release.yml | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e0b8b86..f2304d5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,7 @@ on: push: branches: - main - - sameerdhoot-patch-1 + - sameerdhoot-patch- paths-ignore: - "README.md" - "LICENSE" @@ -12,6 +12,7 @@ on: workflow_dispatch: jobs: + build-alpine: permissions: write-all runs-on: ubuntu-latest @@ -44,3 +45,35 @@ jobs: pull: false context: . file: Dockerfile + + build-debian: + permissions: write-all + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and Push Debian Dockerfile + id: docker_build + uses: docker/build-push-action@v3.2.0 + with: + platforms: linux/arm64,linux/armhf,linux/386,linux/amd64 + push: true + tags: | + ghcr.io/${{ github.repository }}:debian + pull: false + context: . + file: Debian_Dockerfile From 89b0ce560e342f47624ff0f117aaf68388efcf72 Mon Sep 17 00:00:00 2001 From: Sameer Dhoot Date: Thu, 20 Jul 2023 18:27:18 -0400 Subject: [PATCH 08/13] Update Debian_Dockerfile --- Debian_Dockerfile | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Debian_Dockerfile b/Debian_Dockerfile index ffbcaef..f60eaa9 100644 --- a/Debian_Dockerfile +++ b/Debian_Dockerfile @@ -1,5 +1,5 @@ # docker build -t wolweb . -FROM golang:buster AS builder +FROM golang:1.20-buster AS builder LABEL org.label-schema.vcs-url="https://github.com/sameerdhoot/wolweb" \ org.label-schema.url="https://github.com/sameerdhoot/wolweb/blob/master/README.md" @@ -9,9 +9,8 @@ WORKDIR /wolweb # Install Dependecies RUN git clone https://github.com/sameerdhoot/wolweb . && \ - go get -d github.com/gorilla/handlers && \ - go get -d github.com/gorilla/mux && \ - go get -d github.com/ilyakaznacheev/cleanenv + go mod tidy && \ + go mod download # Build Source Files RUN go build -o wolweb . @@ -25,8 +24,16 @@ COPY --from=builder /wolweb/devices.json . COPY --from=builder /wolweb/config.json . COPY --from=builder /wolweb/static ./static +RUN DEBIAN_FRONTEND=noninteractive apt-get update \ + && apt-get install -y \ + curl \ + && rm -rf /var/lib/apt/lists/* + ARG WOLWEBPORT=8089 +ENV WOLWEBPORT=${WOLWEBPORT} CMD ["/wolweb/wolweb"] EXPOSE ${WOLWEBPORT} +HEALTHCHECK --interval=5s --timeout=3s \ + CMD curl --silent --show-error --fail http://localhost:${WOLWEBPORT}/wolweb/health || exit 1 From 20e47cc515d9d00709e5853e629d0710ca8e30d7 Mon Sep 17 00:00:00 2001 From: Sameer Dhoot Date: Thu, 20 Jul 2023 18:27:31 -0400 Subject: [PATCH 09/13] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f2304d5..97886f0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,7 @@ on: push: branches: - main - - sameerdhoot-patch- + - sameerdhoot-patch-1 paths-ignore: - "README.md" - "LICENSE" From c1018b1ac028cb1836cb4c4aa2a3498c425c20f6 Mon Sep 17 00:00:00 2001 From: Sameer Dhoot Date: Fri, 21 Jul 2023 00:31:03 -0400 Subject: [PATCH 10/13] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 97886f0..f2304d5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,7 @@ on: push: branches: - main - - sameerdhoot-patch-1 + - sameerdhoot-patch- paths-ignore: - "README.md" - "LICENSE" From 54af92152d6a32ea74a4d207d394f7e0104465b9 Mon Sep 17 00:00:00 2001 From: Sameer Dhoot Date: Fri, 21 Jul 2023 00:31:23 -0400 Subject: [PATCH 11/13] Update docker-compose.yml --- docker-compose.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 045a549..2860310 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,9 +1,9 @@ version: "3" services: wolweb: - build: . - image: wolweb:latest container_name: wolweb + image: "ghcr.io/sameerdhoot/wolweb" + restart: always # make sure that the file exists in local directory from where you are running the compose file # Or, initialize empty json file by running command "echo '{}' > devices.json" @@ -17,7 +17,7 @@ services: network_mode: host # Use environment variable below to change port or virtual directory. - #environment: - #WOLWEBPORT: "8089" + environment: + WOLWEBPORT: "8089" #WOLWEBVDIR: "/wolweb" - #WOLWEBBCASTIP: "192.168.1.255:9" + WOLWEBBCASTIP: "10.10.10.255:9" From 93b8dcd99af6a4bebc5a5080fea05f558c9ffa47 Mon Sep 17 00:00:00 2001 From: Sameer Dhoot Date: Wed, 26 Jul 2023 15:47:07 -0400 Subject: [PATCH 12/13] Update docker-compose.yml --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 2860310..7366980 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,4 +20,4 @@ services: environment: WOLWEBPORT: "8089" #WOLWEBVDIR: "/wolweb" - WOLWEBBCASTIP: "10.10.10.255:9" + WOLWEBBCASTIP: "192.168.1.255:9" From 71a0dbd0a2c228fce10b97a50cb099780d98d99b Mon Sep 17 00:00:00 2001 From: Sameer Dhoot Date: Wed, 26 Jul 2023 15:51:11 -0400 Subject: [PATCH 13/13] Update release.yml --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f2304d5..cee7328 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,6 @@ on: push: branches: - main - - sameerdhoot-patch- paths-ignore: - "README.md" - "LICENSE"