Version 4.1.1 #25
Workflow file for this run
This file contains hidden or 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
| # Disabling deploying the HTML Storybook until Explorer 1 v3 is complete | |
| # This workflow will do a clean install of Node dependencies, cache/restore them, | |
| # build Storybook as a static web application, and deploy it to the gh-pages branch. | |
| # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
| name: Build and Deploy to GH Pages | |
| on: | |
| workflow_dispatch: | |
| release: | |
| types: [published] | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout 🛎️ | |
| uses: actions/checkout@v6 | |
| - name: Find Latest Licensed Font Run ID | |
| id: find_run | |
| uses: actions/github-script@v8 | |
| with: | |
| github-token: ${{ secrets.EXPLORER_1_FONTS_TOKEN }} | |
| script: | | |
| const { owner, repo } = context.repo; | |
| // Query the private repo for the latest successful workflow run | |
| const runs = await github.rest.actions.listWorkflowRuns({ | |
| owner: 'nasa-jpl', | |
| repo: 'explorer-1-fonts', | |
| workflow_id: 'generate-css-artifact.yml', | |
| branch: 'main', | |
| status: 'success', | |
| per_page: 1 | |
| }); | |
| const runId = runs.data.workflow_runs[0]?.id; | |
| if (!runId) { | |
| core.setFailed("Could not find a successful run for the licensed font workflow."); | |
| return; | |
| } | |
| console.log(`Found Run ID: ${runId}`); | |
| core.setOutput('run_id', runId); | |
| - name: Download Licensed Font Artifact | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: explorer-1-licensed-fonts | |
| repository: nasa-jpl/explorer-1-fonts | |
| path: ./packages/common-storybook/src/ | |
| run-id: ${{ steps.find_run.outputs.run_id }} | |
| github-token: ${{ secrets.EXPLORER_1_FONTS_TOKEN }} | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Set up Node ⬢ | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: '.nvmrc' | |
| cache: 'pnpm' | |
| - name: Install dependencies 🧱 | |
| run: pnpm i | |
| - name: Generate Font Data and Flag Modules (Shell Injection) | |
| run: | | |
| # Ensure the primary shell script is executable | |
| chmod +x packages/common-storybook/src/scripts/inject-fonts-shell.sh | |
| # Execute the shell script, passing all necessary paths as arguments | |
| ./packages/common-storybook/src/scripts/inject-fonts-shell.sh \ | |
| ./packages/common-storybook/src \ | |
| ./packages/common-storybook/src/licensed-fonts-base64.css \ | |
| ./packages/common-storybook/src/fonts-data.js \ | |
| ./packages/common-storybook/src/font-flag.js \ | |
| - name: Build static Storybook 🛠 | |
| run: make vue-storybook-build | |
| env: | |
| VITE_CHROMATIC_BUILD: true | |
| # https://github.com/JamesIves/github-pages-deploy-action/issues/1475#issuecomment-1824079512 | |
| - name: Add nojekyll file to read underscore files 📋 | |
| run: cd apps/vue-storybook/storybook_compiled && touch .nojekyll | |
| - name: Deploy 🚀 | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| folder: apps/vue-storybook/storybook_compiled | |
| branch: gh-pages |