Skip to content

feat(plasma-web, plasma-b2c): PopupBase component #1789

feat(plasma-web, plasma-b2c): PopupBase component

feat(plasma-web, plasma-b2c): PopupBase component #1789

name: PR theme-builder
on:
pull_request:
branches:
- dev
- master
concurrency:
# New commit on branch cancels running workflows of the same branch
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
NPM_REGISTRY_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }}
PR_NAME: pr-${{ github.event.number }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/prepare-environment
- name: Prepare directory for build
run: mkdir s3_build
# TODO: https://github.com/salute-developers/plasma/issues/255
- name: Lerna bootstrap with scope
run: |
npx lerna bootstrap --scope @salutejs/plasma-theme-builder --scope=@salutejs/plasma-{tokens,tokens-utils,typo}
# TODO: https://github.com/salute-developers/plasma/issues/603
- name: Build Theme Builder
env:
REACT_APP_APPLICATION_CLIENT_ID: ${{ secrets.REACT_APP_APPLICATION_CLIENT_ID }}
REACT_APP_AUTH_SERVER_URL: ${{ secrets.REACT_APP_AUTH_SERVER_URL }}
run: |
export NODE_OPTIONS=--openssl-legacy-provider
npm run build --prefix="./website/plasma-theme-builder"
cp -R ./website/plasma-theme-builder/build ./s3_build/plasma-theme-builder-${PR_NAME}
- name: Install s3cmd
run: |
pip3 install s3cmd
- name: s3 Upload 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/plasma-theme-builder-${PR_NAME}/
s3://${{ secrets.AWS_S3_BUCKET_2 }}/pr/plasma-theme-builder-${PR_NAME}/
- name: Post success comment
uses: actions/github-script@v3
with:
github-token: ${{secrets.GH_TOKEN}}
script: |
const branchName = context.payload.pull_request.head.ref;
const themeName = branchName.split('theme-builder-')[1];
const params = themeName ? `?theme=${themeName}&branch=${branchName}` : '';
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Theme Builder app deployed!
http://plasma.sberdevices.ru/pr/plasma-theme-builder-pr-${context.issue.number}/${params}
`
})