Skip to content

Instantly share code, notes, and snippets.

@shide1989
Last active November 18, 2020 16:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shide1989/5b88e41fba3e21b1a5ebc79284c33075 to your computer and use it in GitHub Desktop.
Save shide1989/5b88e41fba3e21b1a5ebc79284c33075 to your computer and use it in GitHub Desktop.
VueJS Bitbucket deployment template, on AWS S3 & Cloudfront

Just a simple Template to configure your VueJS project's CI/CD with Bitbucket, deploying it on AWS S3 & Cloudfront

Make sure you configure your Bitbucket Project's deployment-settings with the correct env variables and that Bitbucket has the correct access rights

image: node:10.15.3
pipelines:
default:
- step:
caches:
- node
script:
- npm ci
- npm run lint
custom:
deploy-sandbox:
- step: &defaults
script:
- npm ci
- npm run build:$VUE_ENV
- pipe: atlassian/aws-s3-deploy:0.4.0
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: eu-west-1
S3_BUCKET: $AWS_S3_BUCKET
LOCAL_PATH: ./dist
ACL: public-read
- pipe: atlassian/aws-cloudfront-invalidate:0.1.1
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: eu-west-1
DISTRIBUTION_ID: $AWS_CF_DISTRIBUTION_ID
deploy-production:
- step:
<<: *defaults
branches:
develop:
- step:
name: Deploy to test
deployment: Staging
<<: *defaults
master:
- step:
name: Deploy to production
deployment: Production
<<: *defaults
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment