stages: - build-and-publish - 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: stage: deploy environment: testing rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH script: - cd /opt/pyzebra - git pull origin main --tags - source /opt/miniconda3/etc/profile.d/conda.sh - conda activate test - conda build ./conda-recipe - conda install --use-local --only-deps pyzebra -y - conda build purge-all - sudo systemctl restart pyzebra-test.service deploy-prod: stage: deploy environment: production needs: ["build-and-publish"] rules: - if: $CI_COMMIT_TAG when: delayed start_in: 1 minute script: - source /opt/miniconda3/etc/profile.d/conda.sh - conda activate prod - conda update pyzebra -y - sudo systemctl restart pyzebra-prod.service