Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: persist env #344

Merged
merged 1 commit into from
Aug 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,12 @@ jobs:
command: |
VERSION=v$(node -p "require('./package.json').version")
echo "export WIDGET_VERSION=$VERSION" >> $BASH_ENV
cp $BASH_ENV widget.env
- persist_to_workspace:
root: ./packages/self-service
paths:
- dist
- widget.env
# Publish - upload self-service to S3 and invalidate cache
upload_to_s3_and_invalidate_cache:
executor: ci-aws
Expand All @@ -150,6 +152,10 @@ jobs:
steps:
- attach_workspace:
at: .
- run:
name: Load environment variables
command: |
cat widget.env >> $BASH_ENV
- aws-cli/setup:
profile-name: default
configure-default-region: false
Expand All @@ -161,6 +167,11 @@ jobs:
from: dist/
to: << parameters.s3_bucket >>
profile_name: ci-web
- aws-s3/copy:
arguments: '--metadata-directive REPLACE --cache-control "max-age=86400" --content-type application/javascript --recursive'
from: << parameters.s3_bucket >>/<< parameters.widget_version >>
to: << parameters.s3_bucket >>/<< parameters.widget_version >>
profile_name: ci-web
- aws-s3/copy:
arguments: '--metadata-directive REPLACE --cache-control "max-age=0" --content-type application/javascript'
from: << parameters.s3_bucket >>/index.js
Expand All @@ -171,11 +182,6 @@ jobs:
from: << parameters.s3_bucket >>/playground/index.html
to: << parameters.s3_bucket >>/playground/index.html
profile_name: ci-web
- aws-s3/copy:
arguments: '--metadata-directive REPLACE --cache-control "max-age=86400" --content-type application/javascript --recursive'
from: << parameters.s3_bucket >>/<< parameters.widget_version >>
to: << parameters.s3_bucket >>/<< parameters.widget_version >>
profile_name: ci-web
- aws-create-invalidation:
distribution-id: << parameters.distribution_id >>
paths: '"/index.js" "/playground/index.html"'
Expand Down