Deploy & Publish #22
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 & Publish | |
on: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
ARTIFACTS_DIR: ./artifacts | |
CI: 1 | |
jobs: | |
pre-release-check: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Prepare Environment | |
uses: ./.github/actions/prepare-env | |
- name: Build packages | |
run: yarn prepack | |
- name: Run Tests | |
run: yarn test | |
publish: | |
name: Publish Packages | |
runs-on: ubuntu-latest | |
needs: [pre-release-check] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: ./.github/actions/prepare-env | |
- name: Publish Packages | |
env: | |
NPM_PUBLISH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: yarn monodeploy --log-level 0 --config-file monodeploy.config.js --push | |
deploy-storybook: | |
name: Build & Deploy Storybook | |
permissions: | |
pages: write | |
id-token: write | |
concurrency: | |
group: "storybook" | |
cancel-in-progress: false | |
environment: | |
name: github-pages | |
url: ${{ steps.deploy-storybook.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: ./.github/actions/prepare-env | |
- name: Cache Storybook Assets | |
uses: actions/cache@v4 | |
with: | |
path: ./.out | |
key: storybook-assets-${{ hashFiles('**/package.json', '**/yarn.lock') }}-${{ hashFiles('**/.storybook/**/*')}} | |
- name: Build Storybook | |
run: yarn docs:build | |
- name: Upload Storybook Artifacts | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: .out/ | |
- name: Deploy Storybook | |
id: deploy-storybook | |
uses: actions/deploy-pages@v4 |