diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e80a7e02..afcc082d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,7 +15,7 @@ default: # ========================================================== .build_template: &build_template stage: build - image: node:20-alpine + image: public.ecr.aws/docker/library/node:20-alpine cache: key: npm-cache paths: @@ -56,7 +56,7 @@ default: .deploy_template: &deploy_template stage: deploy image: - name: amazon/aws-cli:latest + name: public.ecr.aws/aws-cli/aws-cli:latest entrypoint: ['/bin/sh', '-c'] script: - set -e @@ -183,3 +183,31 @@ deploy:staging: environment: name: staging url: https://stg-lti-erp.mbugroup.id + +# ========================================================== +# ====== STAGING (Branch production) ====== +# ========================================================== +build:production: + <<: *build_template + rules: + - if: '$CI_COMMIT_BRANCH == "production"' + environment: + name: staging + variables: + NEXT_PUBLIC_LTI_URL: 'https://lti-erp.mbugroup.id' + NEXT_PUBLIC_SSO_LOGIN_URL: 'https://auth-erp.mbugroup.id' + NEXT_PUBLIC_API_BASE_URL: 'https://api-lti.mbugroup.id/api' + NEXT_PUBLIC_CLIENT_ID: 'Lumbung-Telur-Indonesia' + +deploy:production: + <<: *deploy_template + needs: ['build:production'] + rules: + - if: '$CI_COMMIT_BRANCH == "production"' + variables: + S3_BUCKET: 'production-lti-erp.mbugroup.id' + AWS_REGION: 'ap-southeast-3' + CLOUDFRONT_DISTRIBUTION_ID: 'E1SSLXKYYITASJ' + environment: + name: staging + url: https://lti-erp.mbugroup.id diff --git a/Dockerfile b/Dockerfile index a3a2e197..ff968b26 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:20-alpine +FROM public.ecr.aws/docker/library/node:20-alpine RUN apk add --no-cache git bash build-base curl @@ -22,4 +22,4 @@ RUN mkdir -p .next/server/app/_next && \ EXPOSE 3000 -CMD ["npx", "serve", ".next/server/app", "-l", "3000"] \ No newline at end of file +CMD ["npx", "serve", ".next/server/app", "-l", "3000"]