mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-21 16:38:23 +01:00
Consolidate docsite/storybook CI/CD workflows (#1217)
This commit is contained in:
parent
66675fc3e5
commit
b306eab0d8
20
.github/workflows/deploy-docsite.yml
vendored
20
.github/workflows/deploy-docsite.yml
vendored
@ -1,4 +1,6 @@
|
||||
name: Deploy Docsite and Storybook
|
||||
name: Docsite and Storybook CI/CD
|
||||
|
||||
run-name: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && 'Build and Deploy' || 'Test Build' }} Docsite and Storybook
|
||||
|
||||
env:
|
||||
NODE_VERSION: 20
|
||||
@ -7,9 +9,17 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
# Review gh actions docs if you want to further define triggers, paths, etc
|
||||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
|
||||
workflow_dispatch:
|
||||
# Also run any time a PR is opened targeting the docs or storybook resources
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "docs/**"
|
||||
- "storybook/**"
|
||||
- "**/*.story.*"
|
||||
- "**/*.stories.*"
|
||||
- ".github/workflows/deploy-docsite.yml"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@ -37,11 +47,15 @@ jobs:
|
||||
- name: Copy Storybook to docs
|
||||
run: cp -r storybook-static docs/build/storybook && cp -r assets docs/build/assets/assets
|
||||
- name: Upload Build Artifact
|
||||
# Only upload the build artifact when pushed to the main branch
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: docs/build
|
||||
deploy:
|
||||
name: Deploy to GitHub Pages
|
||||
# Only deploy when pushed to the main branch
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
needs: build
|
||||
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
|
||||
permissions:
|
||||
|
36
.github/workflows/test-build-docsite.yml
vendored
36
.github/workflows/test-build-docsite.yml
vendored
@ -1,36 +0,0 @@
|
||||
name: Test Docsite and Storybook Build
|
||||
|
||||
env:
|
||||
NODE_VERSION: 20
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
# Review gh actions docs if you want to further define triggers, paths, etc
|
||||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
|
||||
paths:
|
||||
- "docs/**"
|
||||
- "storybook/**"
|
||||
- "**/*.story.*"
|
||||
- "**/*.stories.*"
|
||||
jobs:
|
||||
test-deploy:
|
||||
name: Test deployment
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{env.NODE_VERSION}}
|
||||
- name: Install yarn
|
||||
run: |
|
||||
corepack enable
|
||||
yarn install
|
||||
- name: Test build website
|
||||
run: yarn build
|
||||
working-directory: docs/
|
||||
- name: Test build storybook
|
||||
run: yarn build-storybook
|
Loading…
Reference in New Issue
Block a user