Merge pull request #156 from SuperViz/dependabot/npm_and_yarn/uuid-11… #88
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: Publish Playground | |
on: | |
push: | |
branches: | |
- lab | |
- beta | |
- main | |
paths: | |
- 'apps/playground/**' | |
- 'packages/sdk/**' | |
- 'packages/realtime/**' | |
- 'packages/matterport/**' | |
- 'packages/autodesk/**' | |
- 'packages/three/**' | |
- 'packages/yjs/**' | |
- '.github/workflows/playground.ci.yml' | |
jobs: | |
package: | |
env: | |
VITE_SUPERVIZ_ROOM_PREFIX: ${{ secrets.VITE_SUPERVIZ_ROOM_PREFIX }} | |
VITE_SUPERVIZ_DEVELOPER_TOKEN: ${{ secrets.VITE_SUPERVIZ_DEVELOPER_TOKEN }} | |
VITE_MATTERPORT_KEY: ${{ secrets.VITE_MATTERPORT_KEY }} | |
VITE_FORGE_CLIENT_SECRET: ${{ secrets.VITE_FORGE_CLIENT_SECRET }} | |
VITE_FORGE_CLIENT_ID: ${{ secrets.VITE_FORGE_CLIENT_SECRET }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9.10.0 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --no-frozen-lockfile | |
- name: Create a .version.js file | |
run: | | |
touch packages/sdk/.version.js && echo "echo \"export const version = 'lab'\" > packages/sdk/.version.js" | bash - | |
- name: Create a .remote-config.js file | |
run: | | |
touch packages/realtime/.remote-config.js && echo "echo \"module.exports = { remoteConfig: { apiUrl: 'https://dev.nodeapi.superviz.com' }};\" > packages/realtime/.remote-config.js" | bash - | |
touch packages/sdk/.remote-config.js && echo "echo \"module.exports = { remoteConfig: { apiUrl: 'https://dev.nodeapi.superviz.com', conferenceLayerUrl: 'https://video-frame.superviz.com/lab/index.html'}};\" > .remote-config.js" | bash - | |
- name: Build package | |
run: pnpm run build | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-east-1 | |
- name: Deploy static site to S3 bucket | |
run: aws s3 sync apps/playground/dist/ s3://sdk-playground.superviz.com --delete | |
- name: Create Cloudfront invalidation | |
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.PRODUCTION_DISTRIBUTION_ID }} --paths "/*" | |
slack: | |
needs: package | |
name: Slack Notification | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Slack Notification | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_ICON: https://avatars.slack-edge.com/2020-11-18/1496892993975_af721d1c045bea2d5a46_48.png | |
MSG_MINIMAL: true | |
SLACK_USERNAME: Deploy SDK Playground ${{ github.ref_name }} |