stages: - build - deploy build: stage: build image: node:18 rules: - if: $CI_COMMIT_TAG =~ /^[\d]\.[\d]-prod$/ - if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" script: - yarn - yarn build artifacts: paths: - dist deploy-staging: stage: deploy environment: name: staging url: https://api.otpauth-staging.thern.wtf rules: - if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" tags: - shell - prod variables: SECURE_FILES_DOWNLOAD_PATH: ./conf DEPLOY_CONTEXT: staging DEPLOY_PORT: 8084 script: - curl -s https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files/-/raw/main/installer | bash - ./deploy_app.sh deploy-prod: stage: deploy environment: name: production url: https://api.otpauth.thern.wtf rules: - if: $CI_COMMIT_TAG =~ /^[\d]\.[\d]-prod$/ tags: - shell - prod variables: SECURE_FILES_DOWNLOAD_PATH: ./conf DEPLOY_CONTEXT: prod DEPLOY_PORT: 8083 script: - curl -s https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files/-/raw/main/installer | bash - ./deploy_app.sh