diff --git a/.github/workflows/build_and_push.yaml b/.github/workflows/build_and_push.yaml index 4a31d61..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 @@ -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_binary + 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..1e11585 --- /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-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 + +CMD ["./airdao-gov-portal-mailer"]