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 rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH script: - cd /opt/pyzebra - git pull origin master --tags - sudo systemctl restart pyzebra-test.service deploy-prod: stage: deploy needs: ["build-and-publish"] rules: - if: $CI_COMMIT_TAG script: - source /opt/miniconda3/etc/profile.d/conda.sh - conda activate prod - conda update pyzebra -y - sudo systemctl restart pyzebra.service