diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..7be5fae --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,24 @@ +name: Deploy +on: + push: + branches: + - main + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Build Go binary + run: | + docker run --rm \ + -v ${{ github.workspace }}:/workspace \ + -w /workspace/api \ + golang:1.22.5 \ + sh -c 'go mod tidy && go build -o /workspace/api/bin/api cmd/main.go' + + - name: Copy binary and restart service + run: | + cp api/bin/api /home/gaziz/artefacts/tp/main_dc/yalarba/api_yal/bin/api + docker compose -f /home/gaziz/artefacts/tp/main_dc/docker-compose.yml restart api_yal diff --git a/.gitignore b/.gitignore index d3a3a74..0db221a 100644 --- a/.gitignore +++ b/.gitignore @@ -34,4 +34,6 @@ coverage *.tsbuildinfo # Binaries -api/bin/ \ No newline at end of file +api/bin/ +# AGENTS.md (contains secrets) +AGENTS.md