gitea ci
All checks were successful
Deploy / CreateImage (push) Successful in 36s
Deploy / DeployService (push) Successful in 32s

This commit is contained in:
skeris 2025-02-10 00:03:32 +03:00
parent eb5329db35
commit dbee4f4d7b
6 changed files with 55 additions and 82 deletions

@ -0,0 +1,34 @@
name: Deploy
run-name: ${{ gitea.actor }} build image and push to container registry
on:
push:
branches:
- "main"
- "staging"
jobs:
CreateImage:
runs-on: [frontstaging]
uses: http://gitea.pena/PenaDevops/actions.git/.gitea/workflows/build-image.yml@v1.1.6-p
with:
runner: frontstaging
secrets:
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
DeployService:
runs-on: [frontstaging]
container:
image: gitea.pena:3000/penadevops/container-images/node-compose:main
env:
GITHUB_RUN_NUMBER: "${{ inputs.actionid }}"
volumes:
- /run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock
steps:
- name: Check out repository code
uses: http://gitea.pena:3000/PenaDevops/actions.git/checkout@v1
- run: printenv
- run: GITHUB_RUN_NUMBER=${{ gitea.run_id }} compose -f deployments/${{ gitea.ref_name }}/docker-compose.yaml up -d
# uses: http://gitea.pena/PenaDevops/actions.git/.gitea/workflows/deploy.yml@v1.1.6-p
# with:
# runner: frontstaging

14
.gitea/workflows/lint.yml Normal file

@ -0,0 +1,14 @@
name: Lint
run-name: ${{ gitea.actor }} produce linting
on:
push:
branches:
- "sdev"
jobs:
Lint:
runs-on: [hubstaging]
uses: http://gitea.pena/PenaDevops/actions.git/.gitea/workflows/lint.yml@v1.1.2
with:
runner: hubstaging

@ -1,68 +0,0 @@
include:
- project: "devops/pena-continuous-integration"
file: "/templates/docker/build-template.gitlab-ci.yml"
- project: "devops/pena-continuous-integration"
file: "/templates/docker/clean-template.gitlab-ci.yml"
- project: "devops/pena-continuous-integration"
file: "/templates/docker/deploy-template.gitlab-ci.yml"
stages:
- clean
- build
- deploy
clear-old-images:
tags:
- frontbuild
extends: .clean_template
variables:
STAGING_BRANCH: "main"
PRODUCTION_BRANCH: "main"
image:
name: docker/compose:1.28.0
entrypoint: [""]
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker image ls
script:
- docker system prune -af
# check-config:
# tags:
# - frontbuild
# image:
# name: penahub.gitlab.yandexcloud.net:5050/devops/dockerhub-backup/nginx
# before_script:
# - cp /builds/frontend/nginx-proxy/nginx.conf /etc/nginx/nginx.conf
# - cp /builds/frontend/nginx-proxy/default.conf /etc/nginx/conf.d/default.conf
# script:
# - nginx -t
# stage: check
build-app:
tags:
- frontbuild
extends: .build_template
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
variables:
DOCKER_BUILD_PATH: "./Dockerfile"
STAGING_BRANCH: "staging"
PRODUCTION_BRANCH: "main"
script:
- docker build -t $CI_REGISTRY_IMAGE/$CI_COMMIT_BRANCH:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID --build-arg GITLAB_TOKEN=$GITLAB_TOKEN $CI_PROJECT_DIR
- docker push $CI_REGISTRY_IMAGE/$CI_COMMIT_BRANCH:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID
deploy-to-staging:
tags:
- front
- staging
extends: .deploy_template
variables:
PRODUCTION_BRANCH: main
STAGING_BRANCH: staging
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
rules:
- if: "$CI_COMMIT_BRANCH == $PRODUCTION_BRANCH || $CI_COMMIT_BRANCH == $STAGING_BRANCH"
script:
- docker login -u $REGISTRY_USER -p $REGISTRY_TOKEN $CI_REGISTRY
- docker-compose -f deployments/$CI_COMMIT_BRANCH/docker-compose.yaml up -d

@ -1,4 +1,4 @@
FROM penahub.gitlab.yandexcloud.net:5050/devops/dockerhub-backup/nginx FROM gitea.pena/penadevops/container-images/nginx:main as result
COPY privkey.pem /etc/nginx/ COPY privkey.pem /etc/nginx/
COPY fullchain.pem /etc/nginx/ COPY fullchain.pem /etc/nginx/

@ -455,7 +455,7 @@ server {
proxy_set_header X-Client-Port $remote_port; proxy_set_header X-Client-Port $remote_port;
proxy_set_header Origin $host; proxy_set_header Origin $host;
proxy_pass http://10.8.0.5:1492/amocrm/; proxy_pass http://10.7.0.10:1492/amocrm/;
} }
@ -477,7 +477,7 @@ server {
proxy_set_header X-Client-Port $remote_port; proxy_set_header X-Client-Port $remote_port;
proxy_set_header Origin $host; proxy_set_header Origin $host;
proxy_pass http://10.8.0.5:1492/webhook/create/; proxy_pass http://10.7.0.10:1492/webhook/create/;
} }

@ -1,18 +1,11 @@
version: "3"
services: services:
router: router:
container_name: router container_name: router
hostname: router hostname: router
tty: true tty: true
restart: unless-stopped restart: unless-stopped
image: $CI_REGISTRY_IMAGE/staging:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID image: gitea.pena/penaside/nginx-proxy/staging:$GITHUB_RUN_NUMBER
networks:
- marketplace_penahub_frontend
- default
ports: ports:
- 10.6.0.8:80:80 - 92.38.153.12:80:80
- 10.6.0.8:443:443 - 92.38.153.12:443:443
- 10.8.0.7:9123:9123 - 10.7.0.18:9123:9123
networks:
marketplace_penahub_frontend:
external: true