Provide api key in query param for websocket connection (#241) #31
Workflow file for this run
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: Deploy schematic-js | |
permissions: | |
id-token: write | |
contents: read | |
on: | |
push: | |
tags: | |
- "schematic-js@*" | |
workflow_dispatch: | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Yarn install | |
working-directory: ./js | |
run: yarn install | |
- name: Lint | |
working-directory: ./js | |
run: yarn lint | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Yarn install | |
working-directory: ./js | |
run: yarn install | |
- name: Test | |
working-directory: ./js | |
run: yarn test | |
deploy: | |
name: Browser Deploy | |
runs-on: ubuntu-latest | |
needs: ["test", "lint"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set Node.js 20.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Yarn install | |
working-directory: ./js | |
run: yarn install | |
- name: Update version | |
working-directory: ./js | |
run: ./version.sh | |
- name: Build browser bundle | |
working-directory: ./js | |
run: yarn build:browser | |
- name: 🚀auth-oidc-aws-prod | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ vars.PROD_AWS_ROLE_ARN }} | |
aws-region: ${{ vars.PROD_AWS_REGION }} | |
- name: Get package version | |
id: package | |
run: | | |
echo "version=$(node -p "require('./package.json').version")" >> "$GITHUB_OUTPUT" | |
working-directory: ./js | |
- name: Deploy browser build | |
run: | | |
aws s3 cp dist/schematic.browser.js s3://${{ vars.PROD_JS_BUCKET_NAME }}/js/schematic.js | |
aws s3 cp dist/schematic.browser.js s3://${{ vars.PROD_JS_BUCKET_NAME }}/js/schematic.${{ steps.package.outputs.version }}.js | |
aws configure set preview.cloudfront true | |
aws cloudfront create-invalidation --distribution-id ${{ vars.PROD_JS_DISTRIBUTION_ID }} --paths "/js/schematic.js" "/js/schematic.${{ steps.package.outputs.version }}.js" | |
working-directory: ./js | |
publish: | |
name: NPM Publish | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
needs: ["test", "lint"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set Node.js 20.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Yarn install | |
working-directory: ./js | |
run: yarn install | |
- name: Build | |
working-directory: ./js | |
run: yarn build | |
- name: Set up .npmrc | |
run: touch .npmrc && echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
working-directory: ./js | |
- run: yarn publish --access public | |
working-directory: ./js | |
notify_slack: | |
name: Notify Slack | |
runs-on: ubuntu-latest | |
needs: [deploy, publish] | |
steps: | |
- uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_TITLE: Updated schematic-js | |
SLACK_ICON: https://schematic-public-assets.s3.amazonaws.com/logos/logo-transparent.png |