Last active
June 17, 2021 14:23
-
-
Save evzpav/648306a6942ca7b4093a317de0d7b70e to your computer and use it in GitHub Desktop.
Gitlab CI config to build and deploy SPA to S3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stages: | |
- build | |
- deploy | |
variables: | |
APP_NAME: upcoming-movies | |
GIT_DEPTH: 0 | |
BUCKET_NAME: upcomingmovies | |
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID} | |
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY} | |
AWS_DEFAULT_REGION: ${AWS_DEFAULT_REGION} | |
build: | |
stage: build | |
image: node:12 | |
environment: | |
name: production | |
script: | |
- make install-vue | |
- make build-vue | |
artifacts: | |
paths: | |
- ./vue-client/build | |
deploy: | |
stage: deploy | |
image: python:latest | |
dependencies: | |
- build | |
before_script: | |
- pip install awscli | |
script: | |
- aws s3 cp ./vue-client/build s3://${BUCKET_NAME} --recursive | |
environment: | |
name: ${CI_COMMIT_REF_SLUG} | |
url: http://${BUCKET_NAME}.s3-website-${AWS_DEFAULT_REGION}.amazonaws.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment