[add]scenario.toml #3
Workflow file for this run
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 Agents | |
| # Trigger this workflow when pushing agentbeats/green_agent branch | |
| on: | |
| push: | |
| branches: | |
| - agentbeats/green_agent | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| # FieldWorkArena agent images | |
| - name: fwa-server | |
| dockerfile: Dockerfile | |
| - name: fwa-test-purple-agent | |
| dockerfile: scenarios/fwa/Dockerfile.purple_agent | |
| # These permissions are required for the workflow to: | |
| # - Read repository contents (checkout code) | |
| # - Write to GitHub Container Registry (push Docker images) | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| # GITHUB_TOKEN is automatically provided by GitHub Actions | |
| # No manual secret configuration needed! | |
| # It has permissions based on the 'permissions' block above | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata for Docker | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/${{ github.repository }}-${{ matrix.name }} | |
| tags: | | |
| # For branch pushes, create tag with branch name (e.g., 'agentbeats-green_agent') | |
| type=ref,event=branch | |
| - name: Build and push Docker image (${{ matrix.name }}) | |
| id: build | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ${{ matrix.dockerfile }} | |
| # Only push if this is a push event (not a PR) | |
| # PRs will build but not push to avoid polluting the registry | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| # Explicitly build for linux/amd64 (GitHub Actions default) | |
| platforms: linux/amd64 | |
| - name: Output image digest | |
| if: github.event_name != 'pull_request' | |
| run: | | |
| echo "## Docker Image Published: ${{ matrix.name }} :rocket:" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "**Tags:** ${{ steps.meta.outputs.tags }}" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "**Digest:** \`${{ steps.build.outputs.digest }}\`" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "Use this digest in your MANIFEST.json for reproducibility." >> $GITHUB_STEP_SUMMARY |