diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..293715b --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,35 @@ +name: Build and Deploy + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Docker Registry + uses: docker/login-action@v2 + with: + registry: gitea.abzk.fr + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and Push Docker Image + uses: docker/build-push-action@v4 + with: + context: . + push: true + tags: gitea.abzk.fr/jarvis:latest + + - name: Deploy to Portainer + run: | + curl -X POST https://portainer.abzk.fr/api/stacks/1/redeploy \ + -H "X-API-Key: ${{ secrets.PORTAINER_API_KEY }}"