ok
This commit is contained in:
Roger 2024-04-17 00:01:11 +00:00
commit b947d42ac2
3 changed files with 22 additions and 30 deletions

View File

@ -2,11 +2,11 @@ name: Oktopus Frontend
# Controls when the action will run. Triggers the workflow on push or pull request # Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch # events but only for the master branch
on: on:
push: push:
branches: [ dev ] branches: [ main ]
pull_request: pull_request:
branches: [ dev ] branches: [ main ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel # A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs: jobs:
@ -20,9 +20,6 @@ jobs:
- -
name: Checkout name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
- -
name: Set up Docker Buildx name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v1
@ -32,12 +29,11 @@ jobs:
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push -
uses: docker/build-push-action@v2 name: Build Docker image
with: run: docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/frontend:latest -f frontend/build/Dockerfile frontend
context: ../ -
file: ./frontend/build/Dockerfile name: Push Docker image to Docker Hub
platforms: linux/amd64 run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/mqtt:latest
push: true
tags: rogersacchelli/frontend:latest

View File

@ -4,9 +4,9 @@ name: Oktopus MQTT Broker
# events but only for the master branch # events but only for the master branch
on: on:
push: push:
branches: [ dev ] branches: [ main ]
pull_request: pull_request:
branches: [ dev ] branches: [ main ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel # A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs: jobs:
@ -20,9 +20,6 @@ jobs:
- -
name: Checkout name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
- -
name: Set up Docker Buildx name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v1
@ -32,12 +29,11 @@ jobs:
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push -
uses: docker/build-push-action@v2 name: Build Docker image
with: run: docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/mqtt:latest -f backend/services/mtp/mqtt/build/Dockerfile backend/services/mtp/mqtt
context: ./backend/services/mtp/mqtt/ -
file: ./build/Dockerfile name: Push Docker image to Docker Hub
platforms: linux/amd64 run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/mqtt:latest
push: true
tags: rogersacchelli/mqtt:latest

View File

@ -1,6 +1,6 @@
FROM golang:1.22@sha256:82e07063a1ac3ee59e6f38b1222e32ce88469e4431ff6496cc40fb9a0fc18229 as builder FROM golang:1.22@sha256:82e07063a1ac3ee59e6f38b1222e32ce88469e4431ff6496cc40fb9a0fc18229 as builder
WORKDIR /app WORKDIR /app
COPY . . COPY ../ ./
RUN CGO_ENABLED=0 GOOS=linux go build -o mqtt cmd/mqtt/main.go RUN CGO_ENABLED=0 GOOS=linux go build -o mqtt cmd/mqtt/main.go
CMD pwd CMD pwd
FROM alpine:3.14@sha256:0f2d5c38dd7a4f4f733e688e3a6733cb5ab1ac6e3cb4603a5dd564e5bfb80eed FROM alpine:3.14@sha256:0f2d5c38dd7a4f4f733e688e3a6733cb5ab1ac6e3cb4603a5dd564e5bfb80eed