diff --git a/.github/workflows/frontend.yaml b/.github/workflows/frontend.yaml index 5807825..29831d2 100644 --- a/.github/workflows/frontend.yaml +++ b/.github/workflows/frontend.yaml @@ -2,11 +2,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: +on: push: - branches: [ dev ] + branches: [ main ] pull_request: - branches: [ dev ] + branches: [ main ] # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -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: ../ - 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 13c2286..a3d5d91 100644 --- a/.github/workflows/mqtt.yaml +++ b/.github/workflows/mqtt.yaml @@ -4,9 +4,9 @@ name: Oktopus MQTT Broker # events but only for the master branch on: push: - branches: [ dev ] + branches: [ main ] pull_request: - branches: [ dev ] + branches: [ main ] # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -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 backend/services/mtp/mqtt + - + name: Push Docker image to Docker Hub + run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/mqtt:latest + diff --git a/backend/services/mtp/mqtt/build/Dockerfile b/backend/services/mtp/mqtt/build/Dockerfile index 7025ca2..cb80675 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 CMD pwd FROM alpine:3.14@sha256:0f2d5c38dd7a4f4f733e688e3a6733cb5ab1ac6e3cb4603a5dd564e5bfb80eed