project: Move field report title generation logic to server #104
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'GO UI CD' | |
on: | |
pull_request: | |
push: | |
branches: | |
- develop | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-chromatic | |
cancel-in-progress: true | |
permissions: | |
actions: write | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
changed-files: | |
runs-on: ubuntu-latest | |
name: Check for changed files | |
outputs: | |
all_changed_files: ${{ steps.changed-files.outputs.all_changed_files }} | |
any_changed: ${{ steps.changed-files.outputs.any_changed }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v44 | |
with: | |
files: | | |
packages/ui/** | |
packages/go-ui-storybook/** | |
ui: | |
name: Build UI Library | |
environment: 'test' | |
runs-on: ubuntu-latest | |
needs: [changed-files] | |
if: ${{ needs.changed-files.outputs.any_changed == 'true' }} | |
defaults: | |
run: | |
working-directory: packages/ui | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Typecheck | |
run: pnpm typecheck | |
- name: Lint CSS | |
run: pnpm lint:css | |
- name: Lint JS | |
run: pnpm lint:js | |
- name: build UI library | |
run: pnpm build | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ui-build | |
path: packages/ui/dist | |
chromatic: | |
name: Chromatic Deploy | |
runs-on: ubuntu-latest | |
needs: [ui] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install | |
- uses: actions/download-artifact@v4 | |
with: | |
name: ui-build | |
path: packages/ui/dist | |
- name: Run Chromatic | |
uses: chromaui/action@v1 | |
with: | |
exitZeroOnChanges: true | |
exitOnceUploaded: true | |
onlyChanged: true | |
skip: "@(renovate/**|dependabot/**)" | |
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
autoAcceptChanges: "develop" | |
workingDir: packages/go-ui-storybook | |
github-pages: | |
name: Deploy to Github Pages | |
runs-on: ubuntu-latest | |
needs: [ui] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'pnpm' | |
- uses: actions/download-artifact@v4 | |
with: | |
name: ui-build | |
path: packages/ui/dist | |
- uses: bitovi/[email protected] | |
with: | |
install_command: pnpm install | |
build_command: pnpm build-storybook | |
path: packages/go-ui-storybook/storybook-static | |
checkout: false |