| name: Deploy Agentic AI | |
| on: [push] | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build Docker | |
| run: | | |
| docker build -t agentic . | |
| echo "${{ secrets.DOCKER_PASS }}" | docker login -u "${{ secrets.DOCKER_USER }}" --password-stdin | |
| docker tag agentic:latest your-repo/agentic:${{ github.sha }} | |
| docker push your-repo/agentic:${{ github.sha }} | |
| - name: Deploy to DO | |
| uses: appleboy/ssh-action@master | |
| with: | |
| host: ${{ secrets.DO_HOST }} | |
| username: ${{ secrets.DO_USER }} | |
| key: ${{ secrets.DO_KEY }} | |
| script: | | |
| docker pull your-repo/agentic:${{ github.sha }} | |
| docker stop agentic || true | |
| docker run --rm -d -p 8080:8080 --name agentic your-repo/agentic:${{ github.sha }} | |