mirror of
https://github.com/status-im/nimbus-gui.git
synced 2025-02-13 11:56:26 +00:00
ci: make separate workflow for deploying to GH pages
This commit is contained in:
parent
4b2f4f0f3b
commit
1b7eab6ccc
71
.github/workflows/deploy-storybook.yaml
vendored
Normal file
71
.github/workflows/deploy-storybook.yaml
vendored
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
name: 'Deploy Storybook'
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pages: write
|
||||||
|
id-token: write
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: "pages"
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
cache-dependencies:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout Commit
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Cache yarn dependencies and cypress
|
||||||
|
uses: actions/cache@v2
|
||||||
|
id: yarn-cache
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cache/Cypress
|
||||||
|
node_modules
|
||||||
|
key: ${{ runner.os }}-yarn-v3-${{ hashFiles('**/yarn.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-yarn-v3
|
||||||
|
- name: Install dependencies if cache invalid
|
||||||
|
if: steps.yarn-cache.outputs.cache-hit != 'true'
|
||||||
|
run: yarn
|
||||||
|
|
||||||
|
build-and-deploy:
|
||||||
|
environment:
|
||||||
|
name: github-pages
|
||||||
|
url: ${{ steps.deployment.outputs.page_url }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: cache-dependencies
|
||||||
|
steps:
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: '18.x'
|
||||||
|
- name: Setup Pages
|
||||||
|
uses: actions/configure-pages@v3
|
||||||
|
- name: Restore yarn dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
id: yarn-cache
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cache/Cypress
|
||||||
|
node_modules
|
||||||
|
key: ${{ runner.os }}-yarn-v3-${{ hashFiles('**/yarn.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-yarn-v3
|
||||||
|
- name: Install Playwright
|
||||||
|
run: npx playwright install --with-deps
|
||||||
|
- name: Build Storybook
|
||||||
|
run: yarn build-storybook --quiet
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-pages-artifact@v2
|
||||||
|
with:
|
||||||
|
path: './storybook-static'
|
||||||
|
- name: Deploy to GitHub Pages
|
||||||
|
id: deployment
|
||||||
|
uses: actions/deploy-pages@v2
|
||||||
|
- uses: actions/checkout@v2
|
12
.github/workflows/ui-tests.yaml
vendored
12
.github/workflows/ui-tests.yaml
vendored
@ -44,9 +44,6 @@ jobs:
|
|||||||
run: yarn build
|
run: yarn build
|
||||||
|
|
||||||
interaction-and-and-accessibility:
|
interaction-and-and-accessibility:
|
||||||
environment:
|
|
||||||
name: github-pages
|
|
||||||
url: ${{ steps.deployment.outputs.page_url }}
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: cache-dependencies
|
needs: cache-dependencies
|
||||||
steps:
|
steps:
|
||||||
@ -73,12 +70,3 @@ jobs:
|
|||||||
npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
|
npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
|
||||||
"npx http-server storybook-static --port 6006 --silent" \
|
"npx http-server storybook-static --port 6006 --silent" \
|
||||||
"npx wait-on tcp:127.0.0.1:6006 && yarn test-storybook"
|
"npx wait-on tcp:127.0.0.1:6006 && yarn test-storybook"
|
||||||
- name: Setup Pages
|
|
||||||
uses: actions/configure-pages@v3
|
|
||||||
- name: Upload artifact
|
|
||||||
uses: actions/upload-pages-artifact@v2
|
|
||||||
with:
|
|
||||||
path: './storybook-static'
|
|
||||||
- name: Deploy to GitHub Pages
|
|
||||||
id: deployment
|
|
||||||
uses: actions/deploy-pages@v2
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user