Push latest version of @klevu/ui to Klevu CDN #5
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
name: Push latest version of @klevu/ui to Klevu CDN | |
on: | |
workflow_dispatch: | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
environment: production | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.RESOURCES_AWS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.RESOURCES_AWS_SECRET_ACCESS_KEY }} | |
RESOURCES_AWS_BUCKET: ${{ secrets.RESOURCES_AWS_BUCKET }} | |
steps: | |
- name: NPM install | |
run: npm install @klevu/ui | |
- name: Get the version of package | |
id: package-version | |
uses: martinbeentjes/npm-get-version-action@v1.3.1 | |
with: | |
path: node_modules/@klevu/ui | |
- name: Upload to latest folder Klevu CDN | |
run: aws s3 sync ./node_modules/@klevu/ui/dist/ s3://$RESOURCES_AWS_BUCKET/latest/ --region eu-west-1 | |
- name: Upload to version folder Klevu CDN | |
run: aws s3 sync ./node_modules/@klevu/ui/dist/ s3://$RESOURCES_AWS_BUCKET/${{ steps.package-version.outputs.current-version }}/ --region eu-west-1 |