diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index f20bc01..4541f54 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -7,7 +7,7 @@ on: workflow_dispatch: jobs: - validator: + gateway: runs-on: ubuntu-latest steps: - name: Check Out @@ -22,19 +22,19 @@ jobs: - name: Set up Docker BuildX uses: docker/setup-buildx-action@v3 - - name: Extract Validator Metadata + - name: Extract GateWay Metadata id: meta uses: docker/metadata-action@v5 with: - images: ${{ secrets.DOCKER_USERNAME }}/validator + images: ${{ secrets.DOCKER_USERNAME }}/gateway - - name: Build and Push Validator + - name: Build and Push GateWay uses: docker/build-push-action@v6 with: - context: ./code/back/validator - file: ./code/back/validator/Dockerfile + context: ./code/back/gateway + file: ./code/back/gateway/Dockerfile push: true - tags: ${{ secrets.DOCKER_USERNAME }}/validator:${{ github.sha }} + tags: ${{ secrets.DOCKER_USERNAME }}/gateway:${{ github.sha }} labels: ${{ steps.meta.outputs.labels }} integrator: @@ -66,3 +66,33 @@ jobs: push: true tags: ${{ secrets.DOCKER_USERNAME }}/integrator:${{ github.sha }} labels: ${{ steps.meta.outputs.labels }} + + validator: + runs-on: ubuntu-latest + steps: + - name: Check Out + uses: actions/checkout@v4 + + - name: Log in Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + + - name: Set up Docker BuildX + uses: docker/setup-buildx-action@v3 + + - name: Extract Validator Metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ secrets.DOCKER_USERNAME }}/validator + + - name: Build and Push Validator + uses: docker/build-push-action@v6 + with: + context: ./code/back/validator + file: ./code/back/validator/Dockerfile + push: true + tags: ${{ secrets.DOCKER_USERNAME }}/validator:${{ github.sha }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/code/back/gateway/Dockerfile b/code/back/gateway/Dockerfile new file mode 100644 index 0000000..acd657a --- /dev/null +++ b/code/back/gateway/Dockerfile @@ -0,0 +1,9 @@ +FROM golang:alpine AS builder +WORKDIR /app +COPY . . +RUN apk add --no-cache make +RUN go build -ldflags "-s -w" -o ./bin/gateway ./code/back/gateway/cmd + +FROM alpine:latest AS runner +WORKDIR /app +CMD ["./bin/gateway"] diff --git a/code/back/gateway/config.yaml b/code/back/gateway/config.yaml deleted file mode 100644 index f214c60..0000000 --- a/code/back/gateway/config.yaml +++ /dev/null @@ -1,4 +0,0 @@ -database: - connectionString: "postgres://user:password@gateway-db:5432/banks?sslmode=disable" -httPort: 8080 -grpcPort: 8081 \ No newline at end of file