|
1 | 1 | name: Deploy Storybook to Pages |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - branches: ["main"] |
6 | | - workflow_dispatch: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'v*' |
| 7 | + workflow_dispatch: |
7 | 8 |
|
8 | 9 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
9 | 10 | permissions: |
10 | | - contents: read |
11 | | - pages: write |
12 | | - id-token: write |
| 11 | + contents: read |
| 12 | + pages: write |
| 13 | + id-token: write |
13 | 14 |
|
14 | 15 | # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. |
15 | 16 | # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. |
16 | 17 | concurrency: |
17 | | - group: "pages" |
18 | | - cancel-in-progress: false |
| 18 | + group: 'pages' |
| 19 | + cancel-in-progress: false |
19 | 20 |
|
20 | 21 | jobs: |
21 | | - # Single deploy job since we're just deploying |
22 | | - deploy: |
23 | | - environment: |
24 | | - name: github-pages |
25 | | - url: ${{ steps.deployment.outputs.page_url }} |
26 | | - runs-on: ubuntu-latest |
27 | | - steps: |
28 | | - - name: Checkout |
29 | | - uses: actions/checkout@v4 |
30 | | - |
31 | | - - name: Read Node.js version from '.nvmrc' |
32 | | - id: nvmrc |
33 | | - run: | |
34 | | - echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT |
35 | | -
|
36 | | - - name: Setup Node.js |
37 | | - uses: actions/setup-node@v1 |
38 | | - with: |
39 | | - node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }} |
40 | | - |
41 | | - - name: Install dependencies |
42 | | - run: npm ci |
43 | | - |
44 | | - - name: Build storybook |
45 | | - run: npm run build:storybook |
46 | | - |
47 | | - - name: Setup Pages |
48 | | - uses: actions/configure-pages@v3 |
49 | | - |
50 | | - - name: Upload artifact |
51 | | - uses: actions/upload-pages-artifact@v1 |
52 | | - with: |
53 | | - path: './docs' |
54 | | - |
55 | | - - name: Deploy to GitHub Pages |
56 | | - id: deployment |
57 | | - uses: actions/deploy-pages@v2 |
| 22 | + # Single deploy job since we're just deploying |
| 23 | + deploy: |
| 24 | + environment: |
| 25 | + name: github-pages |
| 26 | + url: ${{ steps.deployment.outputs.page_url }} |
| 27 | + runs-on: ubuntu-latest |
| 28 | + steps: |
| 29 | + - name: Checkout |
| 30 | + uses: actions/checkout@v4 |
| 31 | + |
| 32 | + - name: Read Node.js version from '.nvmrc' |
| 33 | + id: nvmrc |
| 34 | + run: | |
| 35 | + echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT |
| 36 | +
|
| 37 | + - name: Setup Node.js |
| 38 | + uses: actions/setup-node@v1 |
| 39 | + with: |
| 40 | + node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }} |
| 41 | + |
| 42 | + - name: Install dependencies |
| 43 | + run: npm ci |
| 44 | + |
| 45 | + - name: Build storybook |
| 46 | + run: npm run build:storybook |
| 47 | + |
| 48 | + - name: Setup Pages |
| 49 | + uses: actions/configure-pages@v3 |
| 50 | + |
| 51 | + - name: Upload artifact |
| 52 | + uses: actions/upload-pages-artifact@v1 |
| 53 | + with: |
| 54 | + path: './docs' |
| 55 | + |
| 56 | + - name: Deploy to GitHub Pages |
| 57 | + id: deployment |
| 58 | + uses: actions/deploy-pages@v2 |
0 commit comments