From 1e88b23d52e1db795c7f521b5d01580aa07a5a75 Mon Sep 17 00:00:00 2001 From: Eshanchik Date: Sun, 25 Feb 2024 16:54:14 +0200 Subject: [PATCH 1/4] add mailer image --- .github/workflows/build_and_push.yaml | 43 +++++++++++++++++++++++++++ Dockerfile_mailer | 10 +++++++ 2 files changed, 53 insertions(+) create mode 100644 Dockerfile_mailer diff --git a/.github/workflows/build_and_push.yaml b/.github/workflows/build_and_push.yaml index 4a31d61..d9a91a1 100644 --- a/.github/workflows/build_and_push.yaml +++ b/.github/workflows/build_and_push.yaml @@ -137,3 +137,46 @@ jobs: run: | rm -rf /tmp/.buildx-cache mv /tmp/.buildx-cache-new /tmp/.buildx-cache + + build_and_publish_mailer: + needs: build_and_publish_db + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + - uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - uses: docker/metadata-action@v3 + id: meta + with: + images: ghcr.io/ambrosus/airdao-gov-user-mailer + + - name: Build and push + uses: docker/build-push-action@v2 + with: + file: Dockerfile_mailer + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new + + - name: Move cachee + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache \ No newline at end of file diff --git a/Dockerfile_mailer b/Dockerfile_mailer new file mode 100644 index 0000000..4f476fc --- /dev/null +++ b/Dockerfile_mailer @@ -0,0 +1,10 @@ +FROM debian:bullseye-slim + +WORKDIR /app + +COPY --from=ghcr.io/ambrosus/airdao-gov-user-binary:main /tmp/builder/target/release/airdao-gov-user-mailer . +COPY --from=ghcr.io/ambrosus/airdao-gov-user-binary:main /tmp/builder/mailer /app/mailer + +RUN apt-get update && apt-get install -y lsb-release ca-certificates libssl-dev && apt-get clean all + +CMD ["./mailer"] From 72cb35f39f8b0c2e6074703c0dc1cc5d89193d77 Mon Sep 17 00:00:00 2001 From: Eshanchik Date: Sun, 25 Feb 2024 17:06:45 +0200 Subject: [PATCH 2/4] fix action --- .github/workflows/build_and_push.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_and_push.yaml b/.github/workflows/build_and_push.yaml index d9a91a1..8edf420 100644 --- a/.github/workflows/build_and_push.yaml +++ b/.github/workflows/build_and_push.yaml @@ -96,7 +96,7 @@ jobs: mv /tmp/.buildx-cache-new /tmp/.buildx-cache build_and_publish_verifier: - needs: build_and_publish_db + needs: build_and_publish_binary runs-on: ubuntu-latest permissions: contents: read @@ -139,7 +139,7 @@ jobs: mv /tmp/.buildx-cache-new /tmp/.buildx-cache build_and_publish_mailer: - needs: build_and_publish_db + needs: build_and_publish_binary runs-on: ubuntu-latest permissions: contents: read From 6da13d353aaddaa383a8381565861a36c161a82c Mon Sep 17 00:00:00 2001 From: Eshanchik Date: Sun, 25 Feb 2024 17:21:25 +0200 Subject: [PATCH 3/4] fix docker file --- Dockerfile_mailer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile_mailer b/Dockerfile_mailer index 4f476fc..08a248b 100644 --- a/Dockerfile_mailer +++ b/Dockerfile_mailer @@ -2,7 +2,7 @@ FROM debian:bullseye-slim WORKDIR /app -COPY --from=ghcr.io/ambrosus/airdao-gov-user-binary:main /tmp/builder/target/release/airdao-gov-user-mailer . +COPY --from=ghcr.io/ambrosus/airdao-gov-user-binary:main /tmp/builder/target/release/airdao-gov-portal-mailer . COPY --from=ghcr.io/ambrosus/airdao-gov-user-binary:main /tmp/builder/mailer /app/mailer RUN apt-get update && apt-get install -y lsb-release ca-certificates libssl-dev && apt-get clean all From 3813e6e4d49a6674e75b7faaf4a91b460fe0a801 Mon Sep 17 00:00:00 2001 From: Eshanchik <39962460+Eshanchik@users.noreply.github.com> Date: Sun, 25 Feb 2024 21:03:25 +0200 Subject: [PATCH 4/4] Update Dockerfile_mailer --- Dockerfile_mailer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile_mailer b/Dockerfile_mailer index 08a248b..1e11585 100644 --- a/Dockerfile_mailer +++ b/Dockerfile_mailer @@ -7,4 +7,4 @@ COPY --from=ghcr.io/ambrosus/airdao-gov-user-binary:main /tmp/builder/mailer /ap RUN apt-get update && apt-get install -y lsb-release ca-certificates libssl-dev && apt-get clean all -CMD ["./mailer"] +CMD ["./airdao-gov-portal-mailer"]