Skip to content

chore: update environment variables (#377) #98

chore: update environment variables (#377)

chore: update environment variables (#377) #98

name: Build and Push Docker Image
on:
push:
branches: [ main, dev ] # or your deployment branch
workflow_dispatch: # allow manual trigger
env:
IMAGE_REPO: ${{ github.repository }}
jobs:
build-and-push-proof-builder-rpc:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write # needed for GitHub Container Registry
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Install Rust
uses: actions-rs/toolchain@v1
timeout-minutes: 30
with:
toolchain: nightly
override: true
- name: "node-cleanup"
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force
sudo docker builder prune -a
- name: Install Ziren toolchain
run: curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/ProjectZKM/toolchain/refs/heads/main/setup.sh | sh
- name: Install Dependencies
run: sudo apt install protobuf-compiler -y
- name: Build binarys
run: export BITCOIN_NETWORK=regtest && source ~/.zkm-toolchain/env && cd proof-builder-rpc && cargo build --release
- name: Generate certs
run: cd circuits/tool && ./certgen.sh
- name: Extract version from Cargo.toml
id: version
run: |
VERSION=$(grep '^version =' ./Cargo.toml | head -n1 | sed -E 's/version = "(.*)"/\1/')
echo "CARGO_VERSION=$VERSION" >> $GITHUB_ENV
echo "Using version: $VERSION"
- name: Set lowercase repo name
id: lowercase
run: echo "REPO_LOWER=$(echo '${{ env.IMAGE_REPO }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Log in to GitHub Container Registry (ghcr.io)
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image (proof-builder-rpc)
uses: docker/build-push-action@v5
with:
context: .
file: ./proof-builder-rpc/Dockerfile
push: true
tags: |
ghcr.io/${{ env.REPO_LOWER }}-proof-builder-rpc:latest
ghcr.io/${{ env.REPO_LOWER }}-proof-builder-rpc:${{ env.CARGO_VERSION }}