Skip to content

Update formio-builder to latest version #11469

Update formio-builder to latest version

Update formio-builder to latest version #11469

Workflow file for this run

name: Build and publish storybook
# Run this workflow every time a new commit pushed to your repository
on:
push:
branches:
- main
pull_request:
branches:
- main
types:
- opened
- reopened
- synchronize
- ready_for_review
workflow_dispatch:
permissions: {}
# Allow one concurrent deployment
concurrency:
group: 'pages-${{ github.ref_name }}' # unique builds for branch/tag name
cancel-in-progress: true
jobs:
storybook:
name: Create storybook build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Set up backend environment
uses: ./.github/actions/setup-backend
with:
optimize-postgres: 'no'
- name: Build Storybook docs
run: |
python src/manage.py collectstatic --noinput
npm run build-storybook
env:
DJANGO_SETTINGS_MODULE: openforms.conf.ci
API_BASE_URL: 'http://localhost:8000'
- name: Upload artifact
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: ./storybook-static
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.event_name == 'push' # Exclude PRs
needs: storybook
steps:
- name: Setup Pages
id: pages
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0
chromatic:
name: Chromatic (interaction & visual tests)
runs-on: ubuntu-latest
needs:
- storybook
# do not run in forks
if: github.event_name == 'push' || ! github.event.pull_request.head.repo.fork
steps:
- name: Checkout repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
fetch-depth: 0 # 👈 Required to retrieve git history
- name: Download build artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: github-pages
path: ./storybook-static
- name: Extract artifact
run: |
tar -xvf artifact.tar
rm artifact.tar
working-directory: ./storybook-static
- name: Publish to Chromatic
uses: chromaui/action@d92ea1ce501f70e8c34745b2c7888648150a368a # v17.2.0
if: github.event.pull_request.draft == false || github.event.push
with:
autoAcceptChanges: main
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
storybookBuildDir: ./storybook-static
onlyChanged: true