From 8cb028014c28f28b3bd9b72c45bc6b724b280123 Mon Sep 17 00:00:00 2001 From: planctus Date: Fri, 4 Oct 2024 13:27:14 +0300 Subject: [PATCH] chore(ci): Reorganizing workflow file --- .github/workflows/ci.yml | 46 ++++++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1977caf38df..ada2aa1be7a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 @@ -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 @@ -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 @@ -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/actions-netlify@v2.0 with: @@ -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: