diff --git a/.gitea/workflows/deployProd.yml b/.gitea/workflows/deployProd.yml new file mode 100644 index 0000000..43d39bb --- /dev/null +++ b/.gitea/workflows/deployProd.yml @@ -0,0 +1,26 @@ +name: Deploy +run-name: ${{ gitea.actor }} build image and push to container registry + +on: + push: + branches: + - 'main' + +jobs: + CreateImage: + runs-on: [frontstaging] + uses: https://gitea.pena/PenaDevops/actions.git/.gitea/workflows/build-image.yml@v1.1.6-p + with: + runner: hubstaging + secrets: + REGISTRY_USER: ${{ secrets.REGISTRY_USER }} + REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} + DeployService: + runs-on: [frontprod] + needs: CreateImage + uses: https://gitea.pena/PenaDevops/actions.git/.gitea/workflows/deploy.yml@v1.1.4-p7 + with: + runner: hubprod + actionid: ${{ gitea.run_id }} + + diff --git a/.gitea/workflows/deployStaging.yml b/.gitea/workflows/deployStaging.yml new file mode 100644 index 0000000..3495235 --- /dev/null +++ b/.gitea/workflows/deployStaging.yml @@ -0,0 +1,26 @@ +name: Deploy +run-name: ${{ gitea.actor }} build image and push to container registry + +on: + push: + branches: + - 'staging' + +jobs: + CreateImage: + runs-on: [hubstaging] + uses: http://gitea.pena/PenaDevops/actions.git/.gitea/workflows/build-image.yml@v1.1.6-p + with: + runner: hubstaging + secrets: + REGISTRY_USER: ${{ secrets.REGISTRY_USER }} + REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} + DeployService: + 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 }} + + diff --git a/.gitea/workflows/lint.yml b/.gitea/workflows/lint.yml new file mode 100644 index 0000000..20e6298 --- /dev/null +++ b/.gitea/workflows/lint.yml @@ -0,0 +1,14 @@ +name: Lint +run-name: ${{ gitea.actor }} produce linting + +on: + push: + branches: + - 'dev' + +jobs: + Lint: + runs-on: [hubstaging] + uses: http://gitea.pena/PenaDevops/actions.git/.gitea/workflows/lint.yml@v1.1.0 + with: + runner: hubstaging diff --git a/Dockerfile b/Dockerfile index 84aad25..b477de8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,17 @@ -FROM node:20.6.0-alpine as build +FROM gitea.pena/penadevops/container-images/node:main as build RUN apk update && rm -rf /var/cache/apk/* WORKDIR /usr/app COPY package.json . COPY tsconfig.json . -RUN yarn install --ignore-scripts --non-interactive --frozen-lockfile && yarn cache clean +RUN npm install --force && yarn cache clean COPY . . RUN ls -RUN yarn build +RUN npm run build -FROM nginx:latest as result +FROM gitea.pena/penadevops/container-images/nginx:main as result WORKDIR /usr/share/nginx/html COPY --from=build /usr/app/build/ /usr/share/nginx/html COPY admin.conf /etc/nginx/conf.d/default.conf diff --git a/deployments/main/docker-compose.yaml b/deployments/main/docker-compose.yaml index ff45333..485e5bb 100644 --- a/deployments/main/docker-compose.yaml +++ b/deployments/main/docker-compose.yaml @@ -1,10 +1,6 @@ -version: "3.3" services: services: - container_name: services_front restart: always - image: $CI_REGISTRY_IMAGE/main:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID - networks: - - default + image: gitea.pena/landings/services/main:$GITHUB_RUN_NUMBER hostname: services tty: true