feat: github action example to build agents #18
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: Build and Push Agent Image | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - feat/github-actions-example | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up Python environment | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.x' | |
| - name: Install BeeAI CLI | |
| run: pip install beeai-cli | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker | |
| uses: docker/setup-docker-action@v4 | |
| with: | |
| daemon-config: '{"features": {"containerd-snapshotter": true}}' | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build and Push | |
| run: | | |
| beeai build ./ --tag ghcr.io/${{ github.repository }}/my-agent:latest --no-import --multi-platform | |
| docker push ghcr.io/${{ github.repository }}/my-agent:latest |