Skip to content

Commit

Permalink
chore(ci): Reorganizing workflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
planctus committed Oct 4, 2024
1 parent 4f1b1dc commit 8cb0280
Showing 1 changed file with 35 additions and 11 deletions.
46 changes: 35 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ jobs:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

audit:
name: audit
name: Audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -26,8 +27,9 @@ jobs:
node-version: 20.9.0
- name: Test
run: ./scripts/audit.sh

tests:
name: tests
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -42,8 +44,9 @@ jobs:
run: yarn build:presets
- name: Test
run: yarn test

size:
name: size
name: Size
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -56,14 +59,12 @@ jobs:
run: yarn dist:presets
- name: Test
run: yarn size-limit
deploy-pull-request-preview:
name: deploy preview

build:
name: Build Application
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20.9.0
Expand All @@ -73,6 +74,21 @@ jobs:
run: yarn build:icons
- name: Package application
run: yarn dist
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: dist
path: dist

deploy-preview:
name: Deploy to Netlify Preview
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
needs: build
steps:
- uses: actions/download-artifact@v3
with:
name: dist
- name: Deploy to Netlify
uses: nwtgck/[email protected]
with:
Expand All @@ -83,22 +99,30 @@ jobs:
NETLIFY: true
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}

chromatic:
name: Run Chromatic
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v3
with:
name: dist
- name: Run Chromatic for EC
uses: chromaui/action@latest
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
storybookBuildDir: dist/website/playground/ec
exitZeroOnChanges: true
onlyStoryNames: 'Components/Accordion'
- name: Run Chromatic for EU
uses: chromaui/action@latest
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
storybookBuildDir: dist/website/playground/eu
exitZeroOnChanges: true
onlyStoryNames: 'Components/Accordion'

deploy-release-branch:
name: deploy release branch
name: Deploy Release Branch
runs-on: ubuntu-latest
if: github.event_name == 'push' && endsWith(github.ref, '-dev')
steps:
Expand Down

0 comments on commit 8cb0280

Please sign in to comment.