diff --git a/.github/workflows/build-agent.yaml b/.github/workflows/build-agent.yaml new file mode 100644 index 0000000..c47847f --- /dev/null +++ b/.github/workflows/build-agent.yaml @@ -0,0 +1,46 @@ +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 \ No newline at end of file