Deploy to S3 via CI
Based on !9 (merged)
This MR adds two CI jobs sync:s3
and destroy:s3
(manual) which deploys and destroys this project to S3.
See the "From CI pipeline" section in the README
.
Additionally, this MR introduces caching of node_modules/
to speed-up the pipeline.
Without AWS-specific environment variables
By default, we run tests and build the website:
build:yarn
does not wait for the test stage to complete.
With AWS-specific environment variables
With the variables set we deploy to S3:
See https://gitlab.com/gitlab-org/status-page/-/jobs/455297985 for a successful deployment to S3:
$ deploy/s3_setup
make_bucket: pleitzen-status-page-mvc-testing
Setting bucket policy
Website at http://pleitzen-status-page-mvc-testing.s3-website-eu-west-1.amazonaws.com
$ deploy/s3_sync
upload: dist/css/app.aef7469a.css to s3://pleitzen-status-page-mvc-testing/css/app.aef7469a.css
upload: dist/index.html to s3://pleitzen-status-page-mvc-testing/index.html
upload: dist/favicon.ico to s3://pleitzen-status-page-mvc-testing/favicon.ico
upload: dist/js/app.16c1292f.js to s3://pleitzen-status-page-mvc-testing/js/app.16c1292f.js
upload: dist/js/app.16c1292f.js.map to s3://pleitzen-status-page-mvc-testing/js/app.16c1292f.js.map
upload: dist/mock.json to s3://pleitzen-status-page-mvc-testing/mock.json
upload: dist/js/chunk-vendors.5a5d1c43.js to s3://pleitzen-status-page-mvc-testing/js/chunk-vendors.5a5d1c43.js
upload: dist/js/chunk-vendors.5a5d1c43.js.map to s3://pleitzen-status-page-mvc-testing/js/chunk-vendors.5a5d1c43.js.map
Deployed!
Verify via http://pleitzen-status-page-mvc-testing.s3-website-eu-west-1.amazonaws.com
Edited by Peter Leitzen