Merge pull request #1614 from opentensor/only-validator-rpc #118
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: Publish Localnet Docker Image | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| inputs: | |
| branch-or-tag: | |
| description: "Branch or tag to use for the Docker image tag and ref to checkout (optional)" | |
| required: false | |
| default: "" | |
| push: | |
| branches: | |
| - devnet-ready | |
| permissions: | |
| contents: read | |
| packages: write | |
| actions: read | |
| security-events: write | |
| jobs: | |
| publish: | |
| runs-on: SubtensorCI | |
| steps: | |
| - name: Determine Docker tag and ref | |
| id: tag | |
| run: | | |
| branch_or_tag="${{ github.event.inputs.branch-or-tag || github.ref_name }}" | |
| echo "Determined branch or tag: $branch_or_tag" | |
| echo "tag=$branch_or_tag" >> $GITHUB_ENV | |
| echo "ref=$branch_or_tag" >> $GITHUB_ENV | |
| # Check if this is a tagged release (not devnet-ready/devnet/testnet) | |
| if [[ "$branch_or_tag" != "devnet-ready" ]]; then | |
| echo "latest_tag=true" >> $GITHUB_ENV | |
| else | |
| echo "latest_tag=false" >> $GITHUB_ENV | |
| fi | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ env.ref }} | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Patch non-fast-block node | |
| run: | | |
| chmod +x ./scripts/localnet_patch.sh | |
| ./scripts/localnet_patch.sh | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: Dockerfile-localnet | |
| push: true | |
| platforms: linux/amd64,linux/arm64 | |
| tags: | | |
| ghcr.io/${{ github.repository }}-localnet:${{ env.tag }} | |
| ${{ env.latest_tag == 'true' && format('ghcr.io/{0}-localnet:latest', github.repository) || '' }} |