add socket path option (#76) #238
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: Docker Image CI | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 3 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to Docker Hub (if credentials available) | |
| if: github.event_name != 'pull_request' | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| continue-on-error: true | |
| - name: Extract metadata | |
| id: meta | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| echo "tag=$(date +%s)" >> $GITHUB_OUTPUT | |
| echo "sha=${GITHUB_SHA::8}" >> $GITHUB_OUTPUT | |
| - name: Build Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| tags: | | |
| testnet-docker-image:${{ steps.meta.outputs.tag }} | |
| testnet-docker-image:${{ steps.meta.outputs.sha }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| push: false | |
| load: true | |
| - name: Test Docker image | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| docker images | grep testnet-docker-image | |
| echo "Docker image built successfully" | |
| - name: Cleanup | |
| if: always() | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| docker system prune -f || true |