Merge 'dev' into 'production': Set up GitLab CI/CD

This commit is contained in:
2025-04-27 19:23:40 +00:00
parent 7a71d89426
commit 296c5bc2e2
4 changed files with 165 additions and 112 deletions

39
.gitlab-ci.yml Normal file
View File

@@ -0,0 +1,39 @@
image: docker:20.10@sha256:2967f0819c84dd589ed0a023b9d25dcfe7a3c123d5bf784ffbb77edf55335f0c
include:
- local: 'backend/.gitlab-ci.yml'
- local: 'frontend/.gitlab-ci.yml'
stages:
- sync
- backend_build
- frontend_build
- deploy
sync_branches:
stage: sync
rules:
- if: '$CI_COMMIT_BRANCH == "production"'
before_script:
- git config --global user.email "gitlab-ci@rhein-software.dev"
- git config --global user.name "GitLab CI"
script:
- git remote set-url origin "https://oauth2:${CI_JOB_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git"
- git checkout dev
- git pull origin dev
- git merge --no-ff origin/production
- git push origin dev
deploy_dev:
stage: deploy
rules:
- if: '$CI_COMMIT_BRANCH == "dev"'
script:
- echo "Deploying DEV environment"
deploy_production:
stage: deploy
rules:
- if: '$CI_COMMIT_BRANCH == "production"'
script:
- echo "Deploying PROD environment"