Split build-and-publish job

[skip ci]
This commit is contained in:
usov_i 2024-09-05 14:57:02 +02:00
parent 19e934e873
commit 982887ab85

View File

@ -1,6 +1,7 @@
stages:
- build-and-publish
- build
- deploy
- publish
- cleanup
default:
@ -11,33 +12,26 @@ workflow:
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
build-and-publish:
stage: build-and-publish
rules:
- if: $CI_COMMIT_TAG
build-job:
stage: build
script:
- 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
- conda build --no-anaconda-upload ./conda-recipe
deploy-test:
deploy-test-job:
stage: deploy
environment: testing
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
script:
- cd /opt/pyzebra
- git pull origin main --tags
- conda activate test
- conda build ./conda-recipe
- conda install --use-local --only-deps pyzebra -y
- sudo systemctl restart pyzebra-test.service
deploy-prod:
deploy-prod-job:
stage: deploy
environment: production
needs: ["build-and-publish"]
rules:
- if: $CI_COMMIT_TAG
when: delayed
@ -47,6 +41,13 @@ deploy-prod:
- conda update pyzebra -y
- sudo systemctl restart pyzebra-prod.service
publish-job:
stage: publish
rules:
- if: $CI_COMMIT_TAG
script:
- anaconda --token $ANACONDA_TOKEN upload $(conda build ./conda-recipe --output)
cleanup-job:
stage: cleanup
script: