fix: address project-review findings #12
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-images | |
| # Builds the orchestrator and agent container images on every push to main | |
| # and publishes them to GHCR (public). Deploy scripts pull these instead of | |
| # building from source on the target VM, which cuts end-to-end Lightsail | |
| # deploy time from ~12 minutes to ~2-3 minutes. | |
| # | |
| # Packages land at: | |
| # ghcr.io/stainlu/openclaw-managed-agents-orchestrator:{latest,sha-<sha>} | |
| # ghcr.io/stainlu/openclaw-managed-agents-agent:{latest,sha-<sha>} | |
| # | |
| # After the first successful publish, make both packages public in the GitHub | |
| # UI (user profile -> Packages -> each package -> Package settings -> | |
| # Change visibility -> Public). Required so deploy scripts can pull without | |
| # auth. | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "Dockerfile.orchestrator" | |
| - "Dockerfile.runtime" | |
| - "package.json" | |
| - "pnpm-lock.yaml" | |
| - "tsconfig.json" | |
| - "src/**" | |
| - "docker/**" | |
| - ".github/workflows/publish-images.yaml" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| packages: write | |
| env: | |
| REGISTRY: ghcr.io | |
| OWNER: stainlu | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: orchestrator | |
| dockerfile: Dockerfile.orchestrator | |
| image: openclaw-managed-agents-orchestrator | |
| - name: agent | |
| dockerfile: Dockerfile.runtime | |
| image: openclaw-managed-agents-agent | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ matrix.image }} | |
| tags: | | |
| type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} | |
| type=sha,prefix=sha- | |
| type=ref,event=branch | |
| - name: Build and push ${{ matrix.name }} | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ${{ matrix.dockerfile }} | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha,scope=${{ matrix.name }} | |
| cache-to: type=gha,scope=${{ matrix.name }},mode=max | |
| provenance: false | |
| - name: Image digest | |
| run: echo "${{ matrix.name }} → ${{ steps.meta.outputs.tags }}" |