From 822f38ee406f3c56acf49bb0a5bce01188cc9e20 Mon Sep 17 00:00:00 2001 From: Nastya Date: Thu, 7 Aug 2025 15:55:25 +0300 Subject: [PATCH] update deploy --- .gitea/workflows/deployStaging.yml | 37 ++++++++++++++----------- Containerfile => Dockerfile | 0 deployments/staging/docker-compose.yaml | 2 +- package.json | 1 + 4 files changed, 23 insertions(+), 17 deletions(-) rename Containerfile => Dockerfile (100%) diff --git a/.gitea/workflows/deployStaging.yml b/.gitea/workflows/deployStaging.yml index 88de5f3..97c1569 100644 --- a/.gitea/workflows/deployStaging.yml +++ b/.gitea/workflows/deployStaging.yml @@ -2,25 +2,30 @@ name: Deploy run-name: ${{ gitea.actor }} build image and push to container registry on: - push: - branches: - - 'staging' + registry_package: + types: [published] jobs: - CreateImage: - runs-on: [skeris] - uses: http://gitea.pena/PenaDevops/actions.git/.gitea/workflows/build-image.yml@v1.1.6-p - with: - runner: skeris - secrets: - REGISTRY_USER: ${{ secrets.REGISTRY_USER }} - REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} + # CreateImage: + # runs-on: [skeris] + # uses: http://gitea.pena/PenaDevops/actions.git/.gitea/workflows/build-image.yml@v1.1.6-p + # with: + # runner: skeris + # secrets: + # REGISTRY_USER: ${{ secrets.REGISTRY_USER }} + # REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} DeployService: + if: contains(github.event.package.name, 'staging') runs-on: [frontstaging] - needs: CreateImage - uses: http://gitea.pena/PenaDevops/actions.git/.gitea/workflows/deploy.yml@v1.1.4-p7 - with: - runner: frontstaging - actionid: ${{ gitea.run_id }} + container: + image: gitea.pena:3000/penadevops/container-images/node-compose:main + env: + GITHUB_RUN_NUMBER: "${{ inputs.actionid }}" + volumes: + - /run/user/1000/docker/docker.sock:/run/user/1000/docker/docker.sock + steps: + - name: Check out repository code + uses: http://gitea.pena:3000/PenaDevops/actions.git/checkout@v1 + - run: compose -f deployments/staging/docker-compose.yaml up -d diff --git a/Containerfile b/Dockerfile similarity index 100% rename from Containerfile rename to Dockerfile diff --git a/deployments/staging/docker-compose.yaml b/deployments/staging/docker-compose.yaml index 5dbfb65..bb47e21 100644 --- a/deployments/staging/docker-compose.yaml +++ b/deployments/staging/docker-compose.yaml @@ -2,7 +2,7 @@ services: hub: container_name: hub restart: unless-stopped - image: gitea.pena/penaside/front-hub/staging:$GITHUB_RUN_NUMBER + image: gitea.pena/penaside/front-hub/staging:latest hostname: hub tty: true diff --git a/package.json b/package.json index 06222fa..ae18836 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "pre-commit": "npm run type-check", "test": "craco test --env=node --transformIgnorePatterns \"node_modules/(?!@frontend)/\"", "test:cart": "vitest ./src/utils/calcCart", + "deploy": "docker login gitea.pena && docker build -t gitea.pena/squiz/front-hub/$(git branch --show-current):latest . && docker push gitea.pena/squiz/front-hub/$(git branch --show-current):latest", "eject": "craco eject", "test:cypress": "start-server-and-test start http://localhost:3000 cypress", "cypress": "cypress open",