Update .gitlab-ci.yml

This commit is contained in:
usov_i 2023-08-16 14:18:59 +02:00
parent b41ab102b1
commit 1a5d61a9f7

View File

@ -1,9 +1,20 @@
stages: stages:
- deploy-test - build-and-publish
- deploy-prod - deploy
build-and-publish:
stage: build-and-publish
rules:
- if: $CI_COMMIT_TAG
script:
- source /opt/miniconda3/etc/profile.d/conda.sh
- conda config --add channels conda-forge
- conda config --set solver libmamba
- conda config --set anaconda_upload yes
- conda build --token $ANACONDA_TOKEN /opt/pyzebra/conda-recipe
deploy-test: deploy-test:
stage: deploy-test stage: deploy
rules: rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
script: script:
@ -12,11 +23,10 @@ deploy-test:
- sudo systemctl restart pyzebra-test.service - sudo systemctl restart pyzebra-test.service
deploy-prod: deploy-prod:
stage: deploy-prod stage: deploy
needs: ["build-and-publish"]
rules: rules:
- if: $CI_COMMIT_TAG - if: $CI_COMMIT_TAG
when: delayed
start_in: 10 minutes
script: script:
- source /opt/miniconda3/etc/profile.d/conda.sh - source /opt/miniconda3/etc/profile.d/conda.sh
- conda activate prod - conda activate prod