Skip to content

Deploy documentation and storybook artifacts to DEV stage #915

Deploy documentation and storybook artifacts to DEV stage

Deploy documentation and storybook artifacts to DEV stage #915

name: Deploy documentation and storybook artifacts to DEV stage
on:
workflow_dispatch:
workflow_run:
workflows: [Release RC]
types: [completed]
jobs:
deploy:
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
show-progress: false
- name: Prepare environment
uses: ./.github/actions/prepare-environment
- name: Lerna bootstrap
run: npx lerna bootstrap
- name: Prepare directories
run: |
mkdir -p s3_build s3_build_sb
- name: Plasma Website
run: |
npm run build --prefix="./website/plasma-website"
cp -R ./website/plasma-website/build ./s3_build/next-${{ github.sha }}
- name: Plasma UI Docs
run: |
npm run build --prefix="./website/plasma-ui-docs"
cp -R ./website/plasma-ui-docs/build ./s3_build/next-${{ github.sha }}/ui
- name: Plasma Web Docs
run: |
npm run build --prefix="./website/plasma-web-docs"
cp -R ./website/plasma-web-docs/build ./s3_build/next-${{ github.sha }}/web
- name: Plasma B2C Docs
run: |
npm run build --prefix="./website/plasma-b2c-docs"
cp -R ./website/plasma-b2c-docs/build ./s3_build/next-${{ github.sha }}/b2c
- name: Plasma SDDS SERV Docs
run: |
npm run build --prefix="./website/sdds-serv-docs"
cp -R ./website/sdds-serv-docs/build ./s3_build/next-${{ github.sha }}/sdds-serv
- name: Plasma SDDS CS Docs
run: |
npm run build --prefix="./website/sdds-cs-docs"
cp -R ./website/sdds-cs-docs/build ./s3_build/next-${{ github.sha }}/sdds-cs
- name: Plasma SDDS DFA Docs
run: |
npm run build --prefix="./website/sdds-dfa-docs"
cp -R ./website/sdds-dfa-docs/build ./s3_build/next-${{ github.sha }}/sdds-dfa
- name: Plasma SDDS INSOL Docs
run: |
npm run build --prefix="./website/sdds-insol-docs"
cp -R ./website/sdds-insol-docs/build ./s3_build/next-${{ github.sha }}/sdds-insol
- name: Plasma UI Storybook
run: |
npm run storybook:build --prefix="./packages/plasma-ui"
cp -R ./packages/plasma-ui/build-sb ./s3_build_sb/ui-storybook
- name: Plasma Web Storybook
run: |
npm run storybook:build --prefix="./packages/plasma-web"
cp -R ./packages/plasma-web/build-sb ./s3_build_sb/web-storybook
- name: Plasma B2C Storybook
run: |
npm run storybook:build --prefix="./packages/plasma-b2c"
cp -R ./packages/plasma-b2c/build-sb ./s3_build_sb/b2c-storybook
- name: Plasma "ASDK" Storybook
run: |
npm run storybook:build --prefix="./packages/plasma-asdk"
cp -R ./packages/plasma-asdk/build-sb ./s3_build_sb/asdk-storybook
- name: Plasma "New-hope" Storybook
run: |
npm run storybook:build --prefix="./packages/plasma-new-hope"
cp -R ./packages/plasma-new-hope/build-sb ./s3_build_sb/new-hope-storybook
- name: Plasma "SDDS SERV" Storybook
run: |
npm run storybook:build --prefix="./packages/sdds-serv"
cp -R ./packages/sdds-serv/build-sb ./s3_build_sb/sdds-serv-storybook
- name: Plasma "SDDS CS" Storybook
run: |
npm run storybook:build --prefix="./packages/sdds-cs"
cp -R ./packages/sdds-cs/build-sb ./s3_build_sb/sdds-cs-storybook
- name: Plasma "SDDS DFA" Storybook
run: |
npm run storybook:build --prefix="./packages/sdds-dfa"
cp -R ./packages/sdds-dfa/build-sb ./s3_build_sb/sdds-dfa-storybook
- name: Plasma "SDDS INSOL" Storybook
run: |
npm run storybook:build --prefix="./packages/sdds-insol"
cp -R ./packages/sdds-insol/build-sb ./s3_build_sb/sdds-insol-storybook
- name: Install s3cmd
run: pip3 install s3cmd
- name: Upload documentation build
run: >
s3cmd
--access_key ${{ secrets.AWS_ACCESS_KEY_ID }}
--secret_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
--host ${{ secrets.AWS_ENDPOINT }}
--host-bucket ${{ secrets.AWS_ENDPOINT }}
--bucket-location ${{ secrets.AWS_REGION }}
--signature-v2
--delete-removed
--no-mime-magic
sync
./s3_build/next-${{ github.sha }}/
s3://${{ secrets.AWS_S3_BUCKET_DEV_STAGE }}/current/
- name: Upload to S3 storybook "Plasma-UI"
run: >
s3cmd
--access_key ${{ secrets.AWS_ACCESS_KEY_ID }}
--secret_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
--host ${{ secrets.AWS_ENDPOINT }}
--host-bucket ${{ secrets.AWS_ENDPOINT }}
--bucket-location ${{ secrets.AWS_REGION }}
--signature-v2
--delete-removed
--no-mime-magic
sync
./s3_build_sb/ui-storybook/
s3://${{ secrets.AWS_S3_BUCKET_DEV_STAGE }}/ui-storybook/
- name: Upload to S3 storybook "Plasma-Web"
run: >
s3cmd
--access_key ${{ secrets.AWS_ACCESS_KEY_ID }}
--secret_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
--host ${{ secrets.AWS_ENDPOINT }}
--host-bucket ${{ secrets.AWS_ENDPOINT }}
--bucket-location ${{ secrets.AWS_REGION }}
--signature-v2
--delete-removed
--no-mime-magic
sync
./s3_build_sb/web-storybook/
s3://${{ secrets.AWS_S3_BUCKET_DEV_STAGE }}/web-storybook/
- name: Upload to S3 storybook "Plasma-b2c"
run: >
s3cmd
--access_key ${{ secrets.AWS_ACCESS_KEY_ID }}
--secret_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
--host ${{ secrets.AWS_ENDPOINT }}
--host-bucket ${{ secrets.AWS_ENDPOINT }}
--bucket-location ${{ secrets.AWS_REGION }}
--signature-v2
--delete-removed
--no-mime-magic
sync
./s3_build_sb/b2c-storybook/
s3://${{ secrets.AWS_S3_BUCKET_DEV_STAGE }}/b2c-storybook/
- name: Upload to S3 storybook "Plasma-ASDK"
run: >
s3cmd
--access_key ${{ secrets.AWS_ACCESS_KEY_ID }}
--secret_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
--host ${{ secrets.AWS_ENDPOINT }}
--host-bucket ${{ secrets.AWS_ENDPOINT }}
--bucket-location ${{ secrets.AWS_REGION }}
--signature-v2
--delete-removed
--no-mime-magic
sync
./s3_build_sb/asdk-storybook/
s3://${{ secrets.AWS_S3_BUCKET_DEV_STAGE }}/asdk-storybook/
- name: Upload to S3 storybook "Plasma-New-Hope"
run: >
s3cmd
--access_key ${{ secrets.AWS_ACCESS_KEY_ID }}
--secret_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
--host ${{ secrets.AWS_ENDPOINT }}
--host-bucket ${{ secrets.AWS_ENDPOINT }}
--bucket-location ${{ secrets.AWS_REGION }}
--signature-v2
--delete-removed
--no-mime-magic
sync
./s3_build_sb/new-hope-storybook/
s3://${{ secrets.AWS_S3_BUCKET_DEV_STAGE }}/new-hope-storybook/
- name: Upload to S3 storybook "SDDS SERV"
run: >
s3cmd
--access_key ${{ secrets.AWS_ACCESS_KEY_ID }}
--secret_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
--host ${{ secrets.AWS_ENDPOINT }}
--host-bucket ${{ secrets.AWS_ENDPOINT }}
--bucket-location ${{ secrets.AWS_REGION }}
--signature-v2
--delete-removed
--no-mime-magic
sync
./s3_build_sb/sdds-serv-storybook/
s3://${{ secrets.AWS_S3_BUCKET_DEV_STAGE }}/sdds-serv-storybook/
- name: Upload to S3 storybook "SDDS INSOL"
run: >
s3cmd
--access_key ${{ secrets.AWS_ACCESS_KEY_ID }}
--secret_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
--host ${{ secrets.AWS_ENDPOINT }}
--host-bucket ${{ secrets.AWS_ENDPOINT }}
--bucket-location ${{ secrets.AWS_REGION }}
--signature-v2
--delete-removed
--no-mime-magic
sync
./s3_build_sb/sdds-insol-storybook/
s3://${{ secrets.AWS_S3_BUCKET_DEV_STAGE }}/sdds-insol-storybook/