diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index e7a2f7b..9c66e7e 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -2,8 +2,8 @@ name: Build & Deploy on: push: - branches: - - main + tags: + - '[0-9]+.[0-9]+.[0-9]+' jobs: deploy: @@ -13,11 +13,21 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Build image + - name: Login au registry + run: | + echo "${{ secrets.REGISTRY_PASSWORD }}" | \ + docker login registry.maisongrondin.fr \ + -u ${{ secrets.REGISTRY_USERNAME }} \ + --password-stdin + + - name: Build et push vers le registry run: | docker build \ - -t budget-commun:latest \ + -t registry.maisongrondin.fr/alexandre/budget-commun:${{ gitea.ref_name }} \ + -t registry.maisongrondin.fr/alexandre/budget-commun:latest \ -f backend/Dockerfile . + docker push registry.maisongrondin.fr/alexandre/budget-commun:${{ gitea.ref_name }} + docker push registry.maisongrondin.fr/alexandre/budget-commun:latest - name: Redéployer sur TrueNAS run: |