Skip to content

Feat: Deploy pr previews #22

Feat: Deploy pr previews

Feat: Deploy pr previews #22

Workflow file for this run

name: Continuous Integration of Pull Request
on:
pull_request:
types:
- opened
- reopened
- synchronize
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "16.19.0"
- name: Install Dependencies
run: yarn
- name: Filter the packages
uses: dorny/paths-filter@v3
id: changes
with:
filters: |
react:
- 'packages/react/**'
ui-elements:
- 'packages/ui-elements/**'
layout_editor:
- 'packages/layout_editor/**'
docs:
- 'packages/docs/**'
- name: Create Build Directory
run: mkdir -p build/pulls/${{github.event.number}}
- name: Build Storybook
if: steps.changes.outputs.react == 'true'
run: yarn build:storybook
working-directory: packages/react
- name: Prepare Build for Storybook
if: steps.changes.outputs.react == 'true'
run: mv -v packages/react/storybook-static/* build/pulls/${{github.event.number}}/
- name: Build UI-Elements
if: steps.changes.outputs.ui-elements == 'true'
run: yarn build:storybook
working-directory: packages/ui-elements
- name: Prepare Build for UI-Elements
if: steps.changes.outputs.ui-elements == 'true'
run: mv -v packages/ui-elements/storybook-static/* build/pulls/${{github.event.number}}/
- name: Setup Node.js 18 for Docs
if: steps.changes.outputs.docs == 'true'
uses: actions/setup-node@v4
with:
node-version: "18.x"
- name: "Install dependencies for docs"
if: steps.changes.outputs.docs == 'true'
run: yarn install
working-directory: packages/docs/
- name: Build Docs
if: steps.changes.outputs.docs == 'true'
run: yarn build
working-directory: packages/docs
- name: Prepare Build for Docs
if: steps.changes.outputs.docs == 'true'
run: mv -v packages/docs/build/* build/pulls/${{github.event.number}}/
- name: Build Layout Editor
if: steps.changes.outputs.layout_editor == 'true'
run: yarn build
working-directory: packages/layout_editor
- name: Prepare Build for Layout Editor
if: steps.changes.outputs.layout_editor == 'true'
run: mv -v packages/layout_editor/dist/* build/pulls/${{github.event.number}}/
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: github-pages
path: build/