diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6028a8cb..ee8a79a5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -73,8 +73,8 @@ stages: if [ "$CI_COMMIT_BRANCH" = "development" ]; then ENVIRONMENT_NAME="WEB-LTI-DEV" - elif [ "$CI_COMMIT_BRANCH" = "master" ]; then - ENVIRONMENT_NAME="WEB-LTI-PROD" + elif [ "$CI_COMMIT_BRANCH" = "staging" ]; then + ENVIRONMENT_NAME="WEB-LTI-STAGING" else ENVIRONMENT_NAME="UNKNOWN" fi @@ -122,8 +122,6 @@ build:dev: environment: name: development variables: - # NEXT_PUBLIC_API_BASE_URL: 'https://dev-api-lti.mbugroup.id' - # NEXT_PUBLIC_SSO_LOGIN_URL: 'https://dev-api-sso.mbugroup.id' NEXT_PUBLIC_LTI_URL: 'https://dev-lti-erp.mbugroup.id' NEXT_PUBLIC_SSO_LOGIN_URL: 'https://dev-auth-erp.mbugroup.id' NEXT_PUBLIC_API_BASE_URL: 'https://dev-api-lti.mbugroup.id/api' @@ -141,6 +139,34 @@ deploy:dev: environment: name: development url: https://dev-lti-erp.mbugroup.id + +# ====== STAGING (Branch staging) ====== +build:staging: + <<: *build_template + rules: + - if: '$CI_COMMIT_BRANCH == "staging"' + environment: + name: staging + variables: + NEXT_PUBLIC_LTI_URL: 'https://stg-lti-erp.mbugroup.id' + NEXT_PUBLIC_SSO_LOGIN_URL: 'https://stg-auth-erp.mbugroup.id' + NEXT_PUBLIC_API_BASE_URL: 'https://stg-api-lti.mbugroup.id/api' + NEXT_PUBLIC_CLIENT_ID: 'Lumbung-Telur-Indonesia' + +deploy:staging: + <<: *deploy_template + needs: ['build:staging'] + rules: + - if: '$CI_COMMIT_BRANCH == "staging"' + variables: + S3_BUCKET: 'stg-lti-erp.mbugroup.id' + AWS_REGION: 'ap-southeast-3' + CLOUDFRONT_DISTRIBUTION_ID: 'E2V6PPO1AUIU7H' + environment: + name: staging + url: https://stg-lti-erp.mbugroup.id + + # ====== PRODUCTION ====== # build:production: # <<: *build_template