Skip to content

Commit

Permalink
publish
Browse files Browse the repository at this point in the history
  • Loading branch information
olegdayo committed Dec 1, 2024
1 parent 228ba4d commit 71ed79f
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 10 deletions.
35 changes: 33 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,36 @@ jobs:
tags: ${{ secrets.DOCKER_USERNAME }}/integrator:${{ github.sha }}
labels: ${{ steps.meta.outputs.labels }}

pingus:
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 Pingus Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ secrets.DOCKER_USERNAME }}/pingus

- name: Build and Push Pingus
uses: docker/build-push-action@v6
with:
context: ./code/back/pingus
file: ./code/back/pingus/Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/pingus:${{ github.sha }}
labels: ${{ steps.meta.outputs.labels }}

validator:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -112,13 +142,13 @@ jobs:
- name: Set up Docker BuildX
uses: docker/setup-buildx-action@v3

- name: Extract WebApp Metadata
- name: Extract Web-App Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ secrets.DOCKER_USERNAME }}/web-app

- name: Build and Push WebApp
- name: Build and Push Web-App
uses: docker/build-push-action@v6
with:
context: ./code/front/web-app
Expand All @@ -132,6 +162,7 @@ jobs:
needs:
- gateway
- integrator
- pingus
- validator
- web-app
steps:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "validator"
name = "pingus"
version = "0.1.0"
edition = "2021"

Expand Down
11 changes: 11 additions & 0 deletions code/back/pingus/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM rust:latest AS builder
WORKDIR /app
COPY . .
RUN apt update && apt install musl-tools -y
RUN rustup target add x86_64-unknown-linux-musl
RUN cargo build --release --target x86_64-unknown-linux-musl

FROM --platform=linux/amd64 alpine:latest AS runner

Check warning on line 8 in code/back/pingus/Dockerfile

View workflow job for this annotation

GitHub Actions / pingus

FROM --platform flag should not use a constant value

FromPlatformFlagConstDisallowed: FROM --platform flag should not use constant value "linux/amd64" More info: https://docs.docker.com/go/dockerfile/rule/from-platform-flag-const-disallowed/
WORKDIR /app
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/pingus .
CMD ["./pingus"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 6 additions & 7 deletions code/back/validator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
FROM rust:latest AS builder
FROM golang:alpine AS builder
WORKDIR /app
COPY . .
RUN apt update && apt install musl-tools -y
RUN rustup target add x86_64-unknown-linux-musl
RUN cargo build --release --target x86_64-unknown-linux-musl
RUN apk add --no-cache make
RUN go build -ldflags "-s -w" -o ./bin/integrator ./cmd

FROM --platform=linux/amd64 alpine:latest AS runner
FROM alpine:latest AS runner
WORKDIR /app
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/validator .
CMD ["./validator"]
COPY --from=builder /app/bin/integrator .
CMD ["./integrator"]

0 comments on commit 71ed79f

Please sign in to comment.