Repository navigation
use MARA slipstream to broadcast non-standard tx (#393) #200
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write # needed for GitHub Container Registry | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Install Ziren toolchain | |
| run: curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/ProjectZKM/toolchain/refs/heads/main/setup.sh | 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: Install Dependencies | |
| run: sudo apt-get update && sudo apt install protobuf-compiler -y | |
| - name: Build all binaries | |
| run: source ~/.zkm-toolchain/env && cargo build -r --workspace | |
| - 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 | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ./ | |
| file: ./node/Dockerfile | |
| push: true | |
| tags: | | |
| ghcr.io/${{ env.REPO_LOWER }}-node:latest | |
| ghcr.io/${{ env.REPO_LOWER }}-node:${{ env.CARGO_VERSION }} |