stages: - build - deploy variables: AWS_DEFAULT_REGION: ap-southeast-1 # The region of our S3 bucket BUCKET_NAME: dowize-box # Your bucket name REACT_APP_API_URL: https://api-dev.dowize.co buildJekyll: # A job to build the static website - replace it with your build methods image: "node:10.16.3-alpine" stage: build script: - node -v - yarn - yarn build # The server is in another timezone.. artifacts: paths: - build # This is what we want to publish, replace with your `dist` directory deploys3: image: "python:latest" # We use python because there is a well-working AWS Sdk stage: deploy dependencies: - buildJekyll # We want to specify dependencies in an explicit way, to avoid confusion if there are different build jobs before_script: - pip install awscli # Install the SDK script: - aws s3 cp build s3://${BUCKET_NAME} --recursive # Replace example-bucket with your bucket environment: name: ${CI_COMMIT_REF_SLUG} url: http://${BUCKET_NAME}.s3-website.${AWS_DEFAULT_REGION}.amazonaws.com # This is the url of the bucket we saved before action: stop # When the branch is merged, we clean up after ourself only: - develop