Example (restrict mode) #16
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: Example (restrict mode) | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Start buildcage builder | |
| id: buildcage | |
| uses: dash14/buildcage/setup@v1 | |
| with: | |
| proxy_mode: restrict | |
| allowed_https_rules: >- | |
| registry.npmjs.org:443 | |
| fonts.googleapis.com:443 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| with: | |
| driver: remote | |
| endpoint: tcp://localhost:${{ steps.buildcage.outputs.port }} | |
| - name: Create test Dockerfile | |
| run: | | |
| mkdir -p /tmp/build-context | |
| cat <<'EOF' > /tmp/build-context/Dockerfile | |
| FROM node:24-alpine | |
| WORKDIR /app | |
| RUN npm init -y && npm install express | |
| RUN wget -q -O /dev/null --timeout=5 https://example.com/ || true | |
| EOF | |
| - name: Build test image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: /tmp/build-context | |
| push: false | |
| no-cache: true | |
| env: | |
| DOCKER_BUILD_SUMMARY: false | |
| DOCKER_BUILD_RECORD_UPLOAD: false | |
| - name: Show proxy report | |
| if: always() | |
| uses: dash14/buildcage/report@v1 | |
| with: | |
| fail_on_blocked: false |