From a09c691e81db2d3cb10001a4131a16c2a3861daa Mon Sep 17 00:00:00 2001 From: Roger Sacchelli Date: Fri, 12 Apr 2024 00:50:20 -0300 Subject: [PATCH 1/7] mqtt build --- .github/workflows/mqtt.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mqtt.yaml b/.github/workflows/mqtt.yaml index 13c2286..9666cfa 100644 --- a/.github/workflows/mqtt.yaml +++ b/.github/workflows/mqtt.yaml @@ -36,7 +36,7 @@ jobs: name: Build and push uses: docker/build-push-action@v2 with: - context: ./backend/services/mtp/mqtt/ + context: ../backend/services/mtp/mqtt/ file: ./build/Dockerfile platforms: linux/amd64 push: true From 317a682e27f132b6ed1fedc10c6de07c7a228b49 Mon Sep 17 00:00:00 2001 From: Roger Sacchelli Date: Fri, 12 Apr 2024 01:06:33 -0300 Subject: [PATCH 2/7] wf mqtt --- .github/workflows/mqtt.yaml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/mqtt.yaml b/.github/workflows/mqtt.yaml index 9666cfa..87ec422 100644 --- a/.github/workflows/mqtt.yaml +++ b/.github/workflows/mqtt.yaml @@ -20,9 +20,6 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 @@ -32,12 +29,11 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v2 - with: - context: ../backend/services/mtp/mqtt/ - file: ./build/Dockerfile - platforms: linux/amd64 - push: true - tags: rogersacchelli/mqtt:latest + + - + name: Build Docker image + run: docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/mqtt:latest -f backend/services/mtp/mqtt/build/Dockerfile . + - + name: Push Docker image to Docker Hub + run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/mqtt:latest + From c7007538cf1658f71f76ad30ea824cd78344a7be Mon Sep 17 00:00:00 2001 From: Roger Sacchelli Date: Fri, 12 Apr 2024 01:11:51 -0300 Subject: [PATCH 3/7] Dockerfile for mqtt fixed --- backend/services/mtp/mqtt/build/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/services/mtp/mqtt/build/Dockerfile b/backend/services/mtp/mqtt/build/Dockerfile index 622703d..5ea1214 100644 --- a/backend/services/mtp/mqtt/build/Dockerfile +++ b/backend/services/mtp/mqtt/build/Dockerfile @@ -1,6 +1,6 @@ FROM golang:1.22@sha256:82e07063a1ac3ee59e6f38b1222e32ce88469e4431ff6496cc40fb9a0fc18229 as builder WORKDIR /app -COPY . . +COPY ../ ./ RUN CGO_ENABLED=0 GOOS=linux go build -o mqtt cmd/mqtt/main.go FROM alpine:3.14@sha256:0f2d5c38dd7a4f4f733e688e3a6733cb5ab1ac6e3cb4603a5dd564e5bfb80eed From 2cf7dc1046f89861780c9290fdc23364b8825bdb Mon Sep 17 00:00:00 2001 From: Roger Sacchelli Date: Fri, 12 Apr 2024 01:16:38 -0300 Subject: [PATCH 4/7] absolute path set --- .github/workflows/mqtt.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mqtt.yaml b/.github/workflows/mqtt.yaml index 87ec422..589cb19 100644 --- a/.github/workflows/mqtt.yaml +++ b/.github/workflows/mqtt.yaml @@ -32,7 +32,7 @@ jobs: - name: Build Docker image - run: docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/mqtt:latest -f backend/services/mtp/mqtt/build/Dockerfile . + run: docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/mqtt:latest -f backend/services/mtp/mqtt/build/Dockerfile backend/services/mtp/mqtt - name: Push Docker image to Docker Hub run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/mqtt:latest From 772198b63180935e9497c5078915658cf10d80a5 Mon Sep 17 00:00:00 2001 From: Roger Sacchelli Date: Fri, 12 Apr 2024 01:28:07 -0300 Subject: [PATCH 5/7] manual workflow --- .github/workflows/frontend.yaml | 29 +++++++++++++---------------- .github/workflows/mqtt.yaml | 9 +++++---- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/.github/workflows/frontend.yaml b/.github/workflows/frontend.yaml index 5807825..23a52d7 100644 --- a/.github/workflows/frontend.yaml +++ b/.github/workflows/frontend.yaml @@ -3,10 +3,11 @@ name: Oktopus Frontend # Controls when the action will run. Triggers the workflow on push or pull request # events but only for the master branch on: - push: - branches: [ dev ] - pull_request: - branches: [ dev ] + workflow_dispatch: # This event triggers the workflow manually + #push: + # branches: [ dev ] + #pull_request: + # branches: [ dev ] # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -20,9 +21,6 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 @@ -32,12 +30,11 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v2 - with: - context: ../ - file: ./frontend/build/Dockerfile - platforms: linux/amd64 - push: true - tags: rogersacchelli/frontend:latest \ No newline at end of file + + - + name: Build Docker image + run: docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/frontend:latest -f frontend/build/Dockerfile frontend + - + name: Push Docker image to Docker Hub + run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/mqtt:latest + diff --git a/.github/workflows/mqtt.yaml b/.github/workflows/mqtt.yaml index 589cb19..d2cd677 100644 --- a/.github/workflows/mqtt.yaml +++ b/.github/workflows/mqtt.yaml @@ -3,10 +3,11 @@ name: Oktopus MQTT Broker # Controls when the action will run. Triggers the workflow on push or pull request # events but only for the master branch on: - push: - branches: [ dev ] - pull_request: - branches: [ dev ] + workflow_dispatch: # This event triggers the workflow manually + #push: + # branches: [ dev ] + #pull_request: + # branches: [ dev ] # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: From e4b81a8dc0043eac7c5edf7d03e6c8c1c181dc86 Mon Sep 17 00:00:00 2001 From: Roger Sacchelli Date: Fri, 12 Apr 2024 01:34:25 -0300 Subject: [PATCH 6/7] wf dispatch --- .github/workflows/frontend.yaml | 4 ++-- .github/workflows/mqtt.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/frontend.yaml b/.github/workflows/frontend.yaml index 23a52d7..52a0c4f 100644 --- a/.github/workflows/frontend.yaml +++ b/.github/workflows/frontend.yaml @@ -2,8 +2,8 @@ name: Oktopus Frontend # Controls when the action will run. Triggers the workflow on push or pull request # events but only for the master branch -on: - workflow_dispatch: # This event triggers the workflow manually +on: + workflow_dispatch # This event triggers the workflow manually #push: # branches: [ dev ] #pull_request: diff --git a/.github/workflows/mqtt.yaml b/.github/workflows/mqtt.yaml index d2cd677..159fb63 100644 --- a/.github/workflows/mqtt.yaml +++ b/.github/workflows/mqtt.yaml @@ -3,7 +3,7 @@ name: Oktopus MQTT Broker # Controls when the action will run. Triggers the workflow on push or pull request # events but only for the master branch on: - workflow_dispatch: # This event triggers the workflow manually + workflow_dispatch # This event triggers the workflow manually #push: # branches: [ dev ] #pull_request: From 5015633ef4ae52a8a59b99db907cae172dd7a211 Mon Sep 17 00:00:00 2001 From: Roger Sacchelli Date: Fri, 12 Apr 2024 01:36:59 -0300 Subject: [PATCH 7/7] workflow only if commit on main --- .github/workflows/frontend.yaml | 9 ++++----- .github/workflows/mqtt.yaml | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/frontend.yaml b/.github/workflows/frontend.yaml index 52a0c4f..29831d2 100644 --- a/.github/workflows/frontend.yaml +++ b/.github/workflows/frontend.yaml @@ -3,11 +3,10 @@ name: Oktopus Frontend # Controls when the action will run. Triggers the workflow on push or pull request # events but only for the master branch on: - workflow_dispatch # This event triggers the workflow manually - #push: - # branches: [ dev ] - #pull_request: - # branches: [ dev ] + push: + branches: [ main ] + pull_request: + branches: [ main ] # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: diff --git a/.github/workflows/mqtt.yaml b/.github/workflows/mqtt.yaml index 159fb63..a3d5d91 100644 --- a/.github/workflows/mqtt.yaml +++ b/.github/workflows/mqtt.yaml @@ -3,11 +3,10 @@ name: Oktopus MQTT Broker # Controls when the action will run. Triggers the workflow on push or pull request # events but only for the master branch on: - workflow_dispatch # This event triggers the workflow manually - #push: - # branches: [ dev ] - #pull_request: - # branches: [ dev ] + push: + branches: [ main ] + pull_request: + branches: [ main ] # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: