From a7bf63053d16721374bbd0190e04b6e39a03a385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Thu, 28 May 2026 23:52:26 +0200 Subject: [PATCH] ci: ajout workflow build & deploy Gitea Actions --- .gitea/workflows/deploy.yml | 41 +++++++++++++++++++++++++++++++++++++ docker-compose.yml | 2 +- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 .gitea/workflows/deploy.yml diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..3997402 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,41 @@ +name: Build & Deploy + +on: + push: + branches: [master] + +env: + REGISTRY: gitea.lan + IMAGE: gitea.lan/shaz/le-site-de-ma-mamounette + +jobs: + build-and-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Login au registry Gitea + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ gitea.actor }} + password: ${{ secrets.REGISTRY_TOKEN }} + + - name: Build & push image + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ${{ env.IMAGE }}:latest + + deploy: + runs-on: ubuntu-latest + needs: build-and-push + + steps: + - name: Pull nouvelle image & redémarrer + run: | + docker pull ${{ env.IMAGE }}:latest + docker compose -f /srv/ssd/stacks/moulin/docker-compose.yml up -d --pull always diff --git a/docker-compose.yml b/docker-compose.yml index 7ce573f..a5af61e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ services: web: - build: . + image: gitea.lan/shaz/le-site-de-ma-mamounette:latest ports: - "127.0.0.1:8082:80" restart: unless-stopped