Skip to content

chore(deps): bump reth-primitives-traits from 383eb23 to f28c71c in /bolt-sidecar #28

chore(deps): bump reth-primitives-traits from 383eb23 to f28c71c in /bolt-sidecar

chore(deps): bump reth-primitives-traits from 383eb23 to f28c71c in /bolt-sidecar #28

# .github/workflows/docker-build-on-comment.yml
# This will only compile x86_64 docker images, NO CROSS-COMPILE!
# NOTE: to make this work, this repository needs write access to the specific containers:
# - bolt-sidecar
# - bolt-boost
# You can configure this in the package settings under Manage Actions access. Make sure to set "role" to "write".
name: Build Docker Image on Comment
on:
issue_comment:
types: [created]
permissions:
contents: read
pull-requests: write
packages: write
jobs:
build:
if: |
github.event.issue.pull_request != null &&
startsWith(github.event.comment.body, '/build ') &&
github.event.comment.author_association == 'COLLABORATOR'
runs-on: self-hosted
steps:
- name: Extract subdirectory and tag from comment
id: extract
run: |
clean_comment=$(echo "${{ github.event.comment.body }}" | tr -d '\r' | xargs)
echo "Comment: $clean_comment"
if [[ "$clean_comment" =~ ^/build[[:space:]]+([^:]+):(.+)$ ]]; then
echo "subdir=${BASH_REMATCH[1]}" >> $GITHUB_ENV
echo "tag=${BASH_REMATCH[2]}" >> $GITHUB_ENV
else
echo "Comment does not match the expected pattern."
exit 1
fi
- name: Checkout PR code
uses: actions/checkout@v4
with:
ref: ${{ github.event.issue.pull_request.head.ref }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: ./${{ env.subdir }}
push: true
tags: ghcr.io/${{ github.repository_owner }}/${{ env.subdir }}:${{ env.tag }}
- name: Post comment on PR
uses: thollander/actions-comment-pull-request@v1
with:
message: |
The Docker image has been successfully built and pushed to GHCR.
Image: `ghcr.io/${{ github.repository_owner }}/${{ env.subdir }}:${{ env.tag }}`
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}