Skip to content

Commit

Permalink
NPM publish
Browse files Browse the repository at this point in the history
  • Loading branch information
bpapillon committed Nov 9, 2023
1 parent a93c66c commit dc14d8b
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,38 @@ jobs:
run: |
echo "::set-output name=version::$(node -p "require('./package.json').version")"
- name: Publish browser build
- name: Deploy browser build
run: |
aws s3 cp --acl=public-read dist/main.js s3://$S3_BUCKET/js/schematic.js
aws s3 cp --acl=public-read dist/main.js s3://$S3_BUCKET/js/schematic.${{ steps.package.outputs.version }}.js
aws s3 cp --acl=public-read dist/browser.js s3://$S3_BUCKET/js/schematic.js
aws s3 cp --acl=public-read dist/browser.js s3://$S3_BUCKET/js/schematic.${{ steps.package.outputs.version }}.js
aws configure set preview.cloudfront true
aws cloudfront create-invalidation --distribution-id ${{ env.CDN_DISTRIBUTION_ID }} --paths "/js/schematic.js" "/js/schematic.${{ steps.package.outputs.version }}.js"
publish:
name: Publish
needs: build
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Set Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
registry-url: 'https://npm.pkg.github.com'
scope: '@schematichq'
- name: Set up .npmrc
run: touch .npmrc && echo "//npm.pkg.github.com/:_authToken=$AUTH_TOKEN" > .npmrc
env:
AUTH_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
- name: NPM check
run: npm whoami --registry https://npm.pkg.github.com
- run: yarn publish
env:
NODE_AUTH_TOKEN: ${{secrets.CH_PERSONAL_ACCESS_TOKEN }}

notify_slack:
name: Notify Slack
runs-on: ubuntu-latest
Expand Down

0 comments on commit dc14d8b

Please sign in to comment.