diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 6d4e643..d173dd2 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -19,22 +19,22 @@ jobs: with: registry: gitea.interno.com username: nucleo000 - password: 7bc7b2fcd283bd6a251bef3ede368b7f897c919d + password: ${{ secrets.GITEA_PASSWORD }} - - name: Build root service + - name: Build root image run: | docker build -f ./Dockerfile \ -t gitea.interno.com/nucleo000/planilla:${{ github.sha }} \ -t gitea.interno.com/nucleo000/planilla:latest . - - name: Build API service + - name: Build API image run: | docker build -f ./api/Dockerfile \ -t gitea.interno.com/nucleo000/planilla-api:${{ github.sha }} \ -t gitea.interno.com/nucleo000/planilla-api:latest \ ./api - - name: Build UI service + - name: Build UI image run: | docker build -f ./ui/Dockerfile \ -t gitea.interno.com/nucleo000/planilla-ui:${{ github.sha }} \ @@ -43,12 +43,10 @@ jobs: - name: Push images run: | - docker push gitea.interno.com/nucleo000/planilla:${{ github.sha }} - docker push gitea.interno.com/nucleo000/planilla:latest - docker push gitea.interno.com/nucleo000/planilla-api:${{ github.sha }} - docker push gitea.interno.com/nucleo000/planilla-api:latest - docker push gitea.interno.com/nucleo000/planilla-ui:${{ github.sha }} - docker push gitea.interno.com/nucleo000/planilla-ui:latest + for img in planilla planilla-api planilla-ui; do + docker push gitea.interno.com/nucleo000/$img:${{ github.sha }} + docker push gitea.interno.com/nucleo000/$img:latest + done deploy: runs-on: docker @@ -58,7 +56,7 @@ jobs: uses: actions/checkout@v3 - name: Login to registry - run: docker login gitea.interno.com -u nucleo000 -p 7bc7b2fcd283bd6a251bef3ede368b7f897c919d + run: docker login gitea.interno.com -u nucleo000 -p ${{ secrets.GITEA_PASSWORD }} - name: Pull latest images run: | @@ -66,10 +64,8 @@ jobs: docker pull gitea.interno.com/nucleo000/planilla-api:latest docker pull gitea.interno.com/nucleo000/planilla-ui:latest - - name: Stop existing containers - run: | - docker rm -f planilla planilla-api planilla-ui || true + - name: Stop existing API & UI + run: docker compose down || true - - name: Restart services - run: | - docker compose --project-name planilla up -d planilla api ui + - name: Start all services + run: docker compose up -d