Deploy widget #23
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 widget | |
permissions: | |
contents: write | |
on: | |
workflow_run: | |
# The current workflow will only run after Publish or Deploy, because we cannot concurrently push to git | |
workflows: [Publish packages to npmjs on PR merge, Deploy pages] | |
types: | |
- completed | |
jobs: | |
build-and-deploy-widget: | |
# Only run if the parent workflow was successful | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 50 | |
- uses: pnpm/action-setup@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'pnpm' | |
- run: pnpm install | |
- name: Build packages | |
run: pnpm run build | |
- run: pnpm run build:widget | |
working-directory: website | |
- name: Configure git before publish | |
run: | | |
git config --global user.name "Joël Charles" | |
git config --global user.email "[email protected]" | |
- name: Set publishing config | |
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}" | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- run: pnpm run release-widget:ci | |
working-directory: website | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |