Commit 45d5cbd0 authored by Anush's avatar Anush

Added CI/CD config

parent c8026f7e
Pipeline #30676705 passed with stages
in 5 minutes and 41 seconds
# Docker Image location on hub.docker.com, its normally your-username/repo-name
image: anushbmx/react-js-ssr-docker
# pipeline will use this image unless specifed in the stage definition
# Define the stages
stages:
- test
- build
- staging
- production
# Define the process for each stage
test:
stage: test
script:
- npm install
- npm test
build:
stage: build
script:
- npm install
- npm run build
- ls -la build
- zip build.zip -r ./build
artifacts:
paths:
- build.zip
deploy_staging:
image: anushbmx/aws-docker
stage: staging
script:
- unzip build.zip
- cd build
- ls -la
- aws s3 cp ./ s3://$AWS_BUCKET_STAGING --recursive
environment:
name: staging
url: $AWS_STAGING_URL
only:
- master
# this stage will only be executed for master branch
deploy_production:
image: anushbmx/aws-docker
stage: production
when: manual
# stage needs manual triger to start.
script:
- unzip build.zip
- cd build
- aws s3 cp ./ s3://$AWS_BUCKET_PRODUCTION --recursive
environment:
name: production
url: $AWS_PRODUCTION_URL
only:
- master
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment