|
| 1 | +name: Deploy Agents |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + paths: |
| 8 | + - '1-uagents/finance/**' |
| 9 | + - '1-uagents/geo/**' |
| 10 | + - '1-uagents/knowledge-base/**' |
| 11 | + - '1-uagents/search/**' |
| 12 | + - '1-uagents/travel/**' |
| 13 | + - '1-uagents/utility/**' |
| 14 | + - '1-uagents/communication/**' |
| 15 | + - 'scripts/deploy-all-agents.sh' |
| 16 | + |
| 17 | +jobs: |
| 18 | + deploy: |
| 19 | + runs-on: ubuntu-latest |
| 20 | + |
| 21 | + steps: |
| 22 | + - name: Checkout code |
| 23 | + uses: actions/checkout@v4 |
| 24 | + |
| 25 | + - name: Download latest AVCTL release binary |
| 26 | + run: | |
| 27 | + LATEST_RELEASE_URL=$(curl -s https://api.github.com/repos/fetchai/avctl/releases/latest \ |
| 28 | + | grep browser_download_url \ |
| 29 | + | grep avctl_Linux_x86_64.tar.gz \ |
| 30 | + | cut -d '"' -f 4) |
| 31 | + |
| 32 | + curl -L -o avctl_Linux_x86_64.tar.gz $LATEST_RELEASE_URL |
| 33 | + |
| 34 | + - name: Extract binary and install |
| 35 | + run: | |
| 36 | + tar -xvf avctl_Linux_x86_64.tar.gz |
| 37 | + chmod +x avctl |
| 38 | + mv avctl /usr/local/bin/avctl |
| 39 | +
|
| 40 | + - name: Authenticate with Agentverse |
| 41 | + run: avctl auth token ${{ secrets.AGENTVERSE_API_KEY }} |
| 42 | + |
| 43 | + - name: Deploy all agents |
| 44 | + run: ./scripts/deploy-all-agents.sh |
| 45 | + env: |
| 46 | + ALPHAVANTAGE_API_KEY: ${{ secrets.ALPHAVANTAGE_API_KEY }} |
| 47 | + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} |
| 48 | + GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} |
| 49 | + GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} |
| 50 | + OCM_API_KEY: ${{ secrets.OCM_API_KEY }} |
| 51 | + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} |
| 52 | + OPENCAGE_API_KEY: ${{ secrets.OPENCAGE_API_KEY }} |
| 53 | + WEATHERAPI_KEY: ${{ secrets.WEATHERAPI_KEY }} |
| 54 | + HUGGINGFACE_API_KEY: ${{ secrets.HUGGINGFACE_API_KEY }} |
| 55 | + GEOAPIFY_API_KEY: ${{ secrets.GEOAPIFY_API_KEY }} |
| 56 | + TAVILY_API_KEY: ${{ secrets.TAVILY_API_KEY }} |
| 57 | + RAPIDAPI_API_KEY: ${{ secrets.RAPIDAPI_API_KEY }} |
| 58 | + SAPLING_API_KEY: ${{ secrets.SAPLING_API_KEY }} |
| 59 | + |
| 60 | + - name: Commit and push changes (avctl folders for new agents) |
| 61 | + if: always() |
| 62 | + run: | |
| 63 | + COMMIT_MESSAGE="chore: add deployment configuration files for new agents" |
| 64 | + |
| 65 | + git config --local user.email "[email protected]" |
| 66 | + git config --local user.name "fetch-bot" |
| 67 | + |
| 68 | + # Add all new avctl files |
| 69 | + git add agents/**.avctl** |
| 70 | + |
| 71 | + # Commit and push any changes |
| 72 | + if git diff --cached --quiet; then |
| 73 | + echo "No changes to commit" |
| 74 | + exit 0 |
| 75 | + fi |
| 76 | + |
| 77 | + git commit -m "$COMMIT_MESSAGE" |
| 78 | + git push origin main |
0 commit comments