From 1d11ba44a6bf245852bd14d77c46d092ad25763d Mon Sep 17 00:00:00 2001 From: Oleksandr Yeshanov <39962460+Eshanchik@users.noreply.github.com> Date: Thu, 20 Jun 2024 21:54:22 +0300 Subject: [PATCH 1/6] Update build_and_push.yaml --- .github/workflows/build_and_push.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_and_push.yaml b/.github/workflows/build_and_push.yaml index 8edf420..7d052c8 100644 --- a/.github/workflows/build_and_push.yaml +++ b/.github/workflows/build_and_push.yaml @@ -4,6 +4,7 @@ on: push: branches: - main + - og-token-support env: REGISTRY: ghcr.io @@ -179,4 +180,4 @@ jobs: - name: Move cachee run: | rm -rf /tmp/.buildx-cache - mv /tmp/.buildx-cache-new /tmp/.buildx-cache \ No newline at end of file + mv /tmp/.buildx-cache-new /tmp/.buildx-cache From 9a3c5e60b295551c0d54bc864e6fca1a6ab546d1 Mon Sep 17 00:00:00 2001 From: Oleksandr Yeshanov <39962460+Eshanchik@users.noreply.github.com> Date: Fri, 21 Jun 2024 13:54:54 +0300 Subject: [PATCH 2/6] Update build_and_push.yaml --- .github/workflows/build_and_push.yaml | 44 ++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build_and_push.yaml b/.github/workflows/build_and_push.yaml index 7d052c8..fd2a78c 100644 --- a/.github/workflows/build_and_push.yaml +++ b/.github/workflows/build_and_push.yaml @@ -36,7 +36,11 @@ jobs: - uses: docker/metadata-action@v3 id: meta with: - images: ghcr.io/ambrosus/airdao-gov-user-binary + images: ${{ env.REGISTRY }}/ambrosus/${{ env.IMAGE_NAME }} + tags: | + type=sha,format=long + type=ref,event=branch + type=raw,value=${{ github.ref_name }} - name: Build and push uses: docker/build-push-action@v2 @@ -48,7 +52,7 @@ jobs: cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache-new - - name: Move cachee + - name: Move cache run: | rm -rf /tmp/.buildx-cache mv /tmp/.buildx-cache-new /tmp/.buildx-cache @@ -80,18 +84,26 @@ jobs: id: meta with: images: ghcr.io/ambrosus/airdao-gov-portal-db + tags: | + type=sha,format=long + type=ref,event=branch + type=raw,value=${{ github.ref_name }} + + - name: Generate temporary Dockerfile + run: | + sed 's/${BRANCH}/'${{ github.ref_name }}'/g' Dockerfile_db > $GITHUB_WORKSPACE/Dockerfile_temp_db - name: Build and push uses: docker/build-push-action@v2 with: - file: Dockerfile_db + file: ${{ github.workspace }}/Dockerfile_temp_db 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 + - name: Move cache run: | rm -rf /tmp/.buildx-cache mv /tmp/.buildx-cache-new /tmp/.buildx-cache @@ -123,18 +135,26 @@ jobs: id: meta with: images: ghcr.io/ambrosus/airdao-gov-user-verifier + tags: | + type=sha,format=long + type=ref,event=branch + type=raw,value=${{ github.ref_name }} + + - name: Generate temporary Dockerfile + run: | + sed 's/${BRANCH}/'${{ github.ref_name }}'/g' Dockerfile_verifier > $GITHUB_WORKSPACE/Dockerfile_temp_verifier - name: Build and push uses: docker/build-push-action@v2 with: - file: Dockerfile_verifier + file: ${{ github.workspace }}/Dockerfile_temp_verifier 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 + - name: Move cache run: | rm -rf /tmp/.buildx-cache mv /tmp/.buildx-cache-new /tmp/.buildx-cache @@ -166,18 +186,26 @@ jobs: id: meta with: images: ghcr.io/ambrosus/airdao-gov-user-mailer + tags: | + type=sha,format=long + type=ref,event=branch + type=raw,value=${{ github.ref_name }} + + - name: Generate temporary Dockerfile + run: | + sed 's/${BRANCH}/'${{ github.ref_name }}'/g' Dockerfile_mailer > $GITHUB_WORKSPACE/Dockerfile_temp_mailer - name: Build and push uses: docker/build-push-action@v2 with: - file: Dockerfile_mailer + file: ${{ github.workspace }}/Dockerfile_temp_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 + - name: Move cache run: | rm -rf /tmp/.buildx-cache mv /tmp/.buildx-cache-new /tmp/.buildx-cache From bf6954d5e184c42afe1455e83a789b1d0a5068f6 Mon Sep 17 00:00:00 2001 From: Eshanchik Date: Fri, 21 Jun 2024 16:05:30 +0300 Subject: [PATCH 3/6] add-multistage-build-and-push-docker --- .github/workflows/build_and_push.yaml | 72 ++------------------------- Dockerfile_binary | 44 ---------------- Dockerfile_db | 50 +++++++++++++++++-- Dockerfile_mailer | 50 +++++++++++++++++-- Dockerfile_verifier | 50 +++++++++++++++++-- 5 files changed, 145 insertions(+), 121 deletions(-) delete mode 100644 Dockerfile_binary diff --git a/.github/workflows/build_and_push.yaml b/.github/workflows/build_and_push.yaml index fd2a78c..d279fe3 100644 --- a/.github/workflows/build_and_push.yaml +++ b/.github/workflows/build_and_push.yaml @@ -5,60 +5,10 @@ on: branches: - main - og-token-support - -env: - REGISTRY: ghcr.io - IMAGE_NAME: airdao-gov-user-binary + - add-multistage-build-and-push-docker jobs: - 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: ${{ env.REGISTRY }}/ambrosus/${{ env.IMAGE_NAME }} - tags: | - type=sha,format=long - type=ref,event=branch - type=raw,value=${{ github.ref_name }} - - - name: Build and push - uses: docker/build-push-action@v2 - with: - file: Dockerfile_binary - 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 cache - run: | - rm -rf /tmp/.buildx-cache - mv /tmp/.buildx-cache-new /tmp/.buildx-cache - build_and_publish_db: - needs: build_and_publish_binary runs-on: ubuntu-latest permissions: contents: read @@ -89,14 +39,10 @@ jobs: type=ref,event=branch type=raw,value=${{ github.ref_name }} - - name: Generate temporary Dockerfile - run: | - sed 's/${BRANCH}/'${{ github.ref_name }}'/g' Dockerfile_db > $GITHUB_WORKSPACE/Dockerfile_temp_db - - name: Build and push uses: docker/build-push-action@v2 with: - file: ${{ github.workspace }}/Dockerfile_temp_db + file: Dockerfile_db push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} @@ -109,7 +55,6 @@ jobs: mv /tmp/.buildx-cache-new /tmp/.buildx-cache build_and_publish_verifier: - needs: build_and_publish_binary runs-on: ubuntu-latest permissions: contents: read @@ -140,14 +85,10 @@ jobs: type=ref,event=branch type=raw,value=${{ github.ref_name }} - - name: Generate temporary Dockerfile - run: | - sed 's/${BRANCH}/'${{ github.ref_name }}'/g' Dockerfile_verifier > $GITHUB_WORKSPACE/Dockerfile_temp_verifier - - name: Build and push uses: docker/build-push-action@v2 with: - file: ${{ github.workspace }}/Dockerfile_temp_verifier + file: Dockerfile_verifier push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} @@ -160,7 +101,6 @@ jobs: mv /tmp/.buildx-cache-new /tmp/.buildx-cache build_and_publish_mailer: - needs: build_and_publish_binary runs-on: ubuntu-latest permissions: contents: read @@ -191,14 +131,10 @@ jobs: type=ref,event=branch type=raw,value=${{ github.ref_name }} - - name: Generate temporary Dockerfile - run: | - sed 's/${BRANCH}/'${{ github.ref_name }}'/g' Dockerfile_mailer > $GITHUB_WORKSPACE/Dockerfile_temp_mailer - - name: Build and push uses: docker/build-push-action@v2 with: - file: ${{ github.workspace }}/Dockerfile_temp_mailer + file: Dockerfile_mailer push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile_binary b/Dockerfile_binary deleted file mode 100644 index bed93d9..0000000 --- a/Dockerfile_binary +++ /dev/null @@ -1,44 +0,0 @@ -FROM debian:bullseye-slim AS builder -WORKDIR /tmp/builder - -COPY . . - -ENV RUSTUP_HOME=/usr/local/rustup \ - CARGO_HOME=/usr/local/cargo \ - PATH=/usr/local/cargo/bin:$PATH \ - RUST_VERSION=1.70.0 - -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - ca-certificates \ - gcc \ - libc6-dev \ - wget \ - ; \ - dpkgArch="$(dpkg --print-architecture)"; \ - case "${dpkgArch##*-}" in \ - amd64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='bb31eaf643926b2ee9f4d8d6fc0e2835e03c0a60f34d324048aa194f0b29a71c' ;; \ - armhf) rustArch='armv7-unknown-linux-gnueabihf'; rustupSha256='6626b90205d7fe7058754c8e993b7efd91dedc6833a11a225b296b7c2941194f' ;; \ - arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='4ccaa7de6b8be1569f6b764acc28e84f5eca342f5162cd5c810891bff7ed7f74' ;; \ - i386) rustArch='i686-unknown-linux-gnu'; rustupSha256='34392b53a25c56435b411d3e575b63aab962034dd1409ba405e708610c829607' ;; \ - *) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \ - esac; \ - url="https://static.rust-lang.org/rustup/archive/1.25.2/${rustArch}/rustup-init"; \ - wget "$url"; \ - echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ - chmod +x rustup-init; \ - ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ - rm rustup-init; \ - chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ - rustup --version; \ - cargo --version; \ - rustc --version; \ - apt-get remove -y --auto-remove \ - wget \ - ; \ - rm -rf /var/lib/apt/lists/*; - -RUN apt-get update && apt-get install -y lsb-release ca-certificates libssl-dev pkg-config && \ - rustup component add rustfmt clippy && \ - cargo build --release diff --git a/Dockerfile_db b/Dockerfile_db index 51bea65..8978475 100644 --- a/Dockerfile_db +++ b/Dockerfile_db @@ -1,9 +1,53 @@ -FROM debian:bullseye-slim +FROM debian:bullseye-slim AS builder +WORKDIR /tmp/builder + +COPY . . + +ENV RUSTUP_HOME=/usr/local/rustup \ + CARGO_HOME=/usr/local/cargo \ + PATH=/usr/local/cargo/bin:$PATH \ + RUST_VERSION=1.70.0 +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + gcc \ + libc6-dev \ + wget \ + ; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "${dpkgArch##*-}" in \ + amd64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='bb31eaf643926b2ee9f4d8d6fc0e2835e03c0a60f34d324048aa194f0b29a71c' ;; \ + armhf) rustArch='armv7-unknown-linux-gnueabihf'; rustupSha256='6626b90205d7fe7058754c8e993b7efd91dedc6833a11a225b296b7c2941194f' ;; \ + arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='4ccaa7de6b8be1569f6b764acc28e84f5eca342f5162cd5c810891bff7ed7f74' ;; \ + i386) rustArch='i686-unknown-linux-gnu'; rustupSha256='34392b53a25c56435b411d3e575b63aab962034dd1409ba405e708610c829607' ;; \ + *) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \ + esac; \ + url="https://static.rust-lang.org/rustup/archive/1.25.2/${rustArch}/rustup-init"; \ + wget "$url"; \ + echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ + chmod +x rustup-init; \ + ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ + rm rustup-init; \ + chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ + rustup --version; \ + cargo --version; \ + rustc --version; \ + apt-get remove -y --auto-remove \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; +RUN apt-get update && apt-get install -y lsb-release ca-certificates libssl-dev pkg-config && \ + rustup component add rustfmt clippy && \ + cargo build --release + + +FROM debian:bullseye-slim WORKDIR /app -COPY --from=ghcr.io/ambrosus/airdao-gov-user-binary:main /tmp/builder/target/release/airdao-gov-portal-db . -COPY --from=ghcr.io/ambrosus/airdao-gov-user-binary:main /tmp/builder/gov-portal-db /app/gov-portal-db +COPY --from=builder /tmp/builder/target/release/airdao-gov-portal-db . +COPY --from=builder /tmp/builder/gov-portal-db /app/gov-portal-db RUN apt-get update && apt-get install -y lsb-release ca-certificates libssl-dev && apt-get clean all diff --git a/Dockerfile_mailer b/Dockerfile_mailer index 1e11585..21d7191 100644 --- a/Dockerfile_mailer +++ b/Dockerfile_mailer @@ -1,9 +1,53 @@ -FROM debian:bullseye-slim +FROM debian:bullseye-slim AS builder +WORKDIR /tmp/builder + +COPY . . + +ENV RUSTUP_HOME=/usr/local/rustup \ + CARGO_HOME=/usr/local/cargo \ + PATH=/usr/local/cargo/bin:$PATH \ + RUST_VERSION=1.70.0 +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + gcc \ + libc6-dev \ + wget \ + ; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "${dpkgArch##*-}" in \ + amd64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='bb31eaf643926b2ee9f4d8d6fc0e2835e03c0a60f34d324048aa194f0b29a71c' ;; \ + armhf) rustArch='armv7-unknown-linux-gnueabihf'; rustupSha256='6626b90205d7fe7058754c8e993b7efd91dedc6833a11a225b296b7c2941194f' ;; \ + arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='4ccaa7de6b8be1569f6b764acc28e84f5eca342f5162cd5c810891bff7ed7f74' ;; \ + i386) rustArch='i686-unknown-linux-gnu'; rustupSha256='34392b53a25c56435b411d3e575b63aab962034dd1409ba405e708610c829607' ;; \ + *) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \ + esac; \ + url="https://static.rust-lang.org/rustup/archive/1.25.2/${rustArch}/rustup-init"; \ + wget "$url"; \ + echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ + chmod +x rustup-init; \ + ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ + rm rustup-init; \ + chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ + rustup --version; \ + cargo --version; \ + rustc --version; \ + apt-get remove -y --auto-remove \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; +RUN apt-get update && apt-get install -y lsb-release ca-certificates libssl-dev pkg-config && \ + rustup component add rustfmt clippy && \ + cargo build --release + + +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 +COPY --from=builder /tmp/builder/target/release/airdao-gov-portal-mailer . +COPY --from=builder /tmp/builder/mailer /app/mailer RUN apt-get update && apt-get install -y lsb-release ca-certificates libssl-dev && apt-get clean all diff --git a/Dockerfile_verifier b/Dockerfile_verifier index 7f48d3e..208962a 100644 --- a/Dockerfile_verifier +++ b/Dockerfile_verifier @@ -1,9 +1,53 @@ -FROM debian:bullseye-slim +FROM debian:bullseye-slim AS builder +WORKDIR /tmp/builder + +COPY . . + +ENV RUSTUP_HOME=/usr/local/rustup \ + CARGO_HOME=/usr/local/cargo \ + PATH=/usr/local/cargo/bin:$PATH \ + RUST_VERSION=1.70.0 +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + gcc \ + libc6-dev \ + wget \ + ; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "${dpkgArch##*-}" in \ + amd64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='bb31eaf643926b2ee9f4d8d6fc0e2835e03c0a60f34d324048aa194f0b29a71c' ;; \ + armhf) rustArch='armv7-unknown-linux-gnueabihf'; rustupSha256='6626b90205d7fe7058754c8e993b7efd91dedc6833a11a225b296b7c2941194f' ;; \ + arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='4ccaa7de6b8be1569f6b764acc28e84f5eca342f5162cd5c810891bff7ed7f74' ;; \ + i386) rustArch='i686-unknown-linux-gnu'; rustupSha256='34392b53a25c56435b411d3e575b63aab962034dd1409ba405e708610c829607' ;; \ + *) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \ + esac; \ + url="https://static.rust-lang.org/rustup/archive/1.25.2/${rustArch}/rustup-init"; \ + wget "$url"; \ + echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ + chmod +x rustup-init; \ + ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ + rm rustup-init; \ + chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ + rustup --version; \ + cargo --version; \ + rustc --version; \ + apt-get remove -y --auto-remove \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; +RUN apt-get update && apt-get install -y lsb-release ca-certificates libssl-dev pkg-config && \ + rustup component add rustfmt clippy && \ + cargo build --release + + +FROM debian:bullseye-slim WORKDIR /app -COPY --from=ghcr.io/ambrosus/airdao-gov-user-binary:main /tmp/builder/target/release/airdao-gov-user-verifier . -COPY --from=ghcr.io/ambrosus/airdao-gov-user-binary:main /tmp/builder/config /app/config +COPY --from=builder /tmp/builder/target/release/airdao-gov-user-verifier . +COPY --from=builder /tmp/builder/config /app/config RUN apt-get update && apt-get install -y lsb-release ca-certificates libssl-dev && apt-get clean all From 062cd2e7944cf4b5561e78dbcf50a4c6f68f2c60 Mon Sep 17 00:00:00 2001 From: Eshanchik Date: Fri, 21 Jun 2024 16:18:35 +0300 Subject: [PATCH 4/6] rm cache --- .github/workflows/build_and_push.yaml | 46 ++------------------------- 1 file changed, 3 insertions(+), 43 deletions(-) diff --git a/.github/workflows/build_and_push.yaml b/.github/workflows/build_and_push.yaml index d279fe3..bf3499d 100644 --- a/.github/workflows/build_and_push.yaml +++ b/.github/workflows/build_and_push.yaml @@ -17,14 +17,7 @@ jobs: - 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 @@ -38,7 +31,7 @@ jobs: type=sha,format=long type=ref,event=branch type=raw,value=${{ github.ref_name }} - + - name: Build and push uses: docker/build-push-action@v2 with: @@ -46,13 +39,7 @@ jobs: 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 cache - run: | - rm -rf /tmp/.buildx-cache - mv /tmp/.buildx-cache-new /tmp/.buildx-cache + build_and_publish_verifier: runs-on: ubuntu-latest @@ -64,13 +51,6 @@ jobs: - 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 @@ -92,13 +72,6 @@ jobs: 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 cache - run: | - rm -rf /tmp/.buildx-cache - mv /tmp/.buildx-cache-new /tmp/.buildx-cache build_and_publish_mailer: runs-on: ubuntu-latest @@ -110,13 +83,6 @@ jobs: - 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 @@ -138,10 +104,4 @@ jobs: 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 cache - run: | - rm -rf /tmp/.buildx-cache - mv /tmp/.buildx-cache-new /tmp/.buildx-cache From 4721aa8bbfb411dec6736bf7927a6e412374b7a5 Mon Sep 17 00:00:00 2001 From: ZelionD Date: Fri, 21 Jun 2024 11:29:04 -0400 Subject: [PATCH 5/6] revert config to 0.13 due to issue with 0.14 --- Cargo.lock | 5 +++-- Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 899cc88..a3c4f44 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -466,10 +466,11 @@ dependencies = [ [[package]] name = "config" -version = "0.14.0" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7328b20597b53c2454f0b1919720c25c7339051c02b72b7e05409e00b14132be" +checksum = "23738e11972c7643e4ec947840fc463b6a571afcd3e735bdfce7d03c7a784aca" dependencies = [ + "async-trait", "lazy_static", "nom", "pathdiff", diff --git a/Cargo.toml b/Cargo.toml index 503a2e1..d8f25c9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,7 +51,7 @@ redis = "0" # Misc backtrace = "0" uuid = { version = "1", features = ["v4", "serde"] } -config = { version = "0", default_features = false, features = ["json"] } +config = { version = "0.13", default_features = false, features = ["json"] } chrono = { version = "0", default_features = false, features = ["clock", "serde"] } assert_matches = "1" thiserror = "1" From 6645fa3ba708570ebf6adc19f0e877cf76dae8d2 Mon Sep 17 00:00:00 2001 From: Eshanchik Date: Fri, 21 Jun 2024 19:00:56 +0300 Subject: [PATCH 6/6] rm cache and label --- .github/workflows/build_and_push.yaml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.github/workflows/build_and_push.yaml b/.github/workflows/build_and_push.yaml index bf3499d..596d5e4 100644 --- a/.github/workflows/build_and_push.yaml +++ b/.github/workflows/build_and_push.yaml @@ -5,7 +5,6 @@ on: branches: - main - og-token-support - - add-multistage-build-and-push-docker jobs: build_and_publish_db: @@ -27,10 +26,6 @@ jobs: id: meta with: images: ghcr.io/ambrosus/airdao-gov-portal-db - tags: | - type=sha,format=long - type=ref,event=branch - type=raw,value=${{ github.ref_name }} - name: Build and push uses: docker/build-push-action@v2 @@ -60,10 +55,6 @@ jobs: id: meta with: images: ghcr.io/ambrosus/airdao-gov-user-verifier - tags: | - type=sha,format=long - type=ref,event=branch - type=raw,value=${{ github.ref_name }} - name: Build and push uses: docker/build-push-action@v2 @@ -92,10 +83,6 @@ jobs: id: meta with: images: ghcr.io/ambrosus/airdao-gov-user-mailer - tags: | - type=sha,format=long - type=ref,event=branch - type=raw,value=${{ github.ref_name }} - name: Build and push uses: docker/build-push-action@v2