diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml index b877193..51b07e9 100644 --- a/.github/workflows/chromatic.yml +++ b/.github/workflows/chromatic.yml @@ -8,10 +8,11 @@ on: branches: - develop paths: - - '**/*.stories.tsx' + - "**/*.stories.tsx" jobs: chromatic: + if: github.event.pull_request.labels.*.name != 'skip-build' name: Run Chromatic Deployment # Operating System runs-on: ubuntu-latest diff --git a/.github/workflows/pr_test.yaml b/.github/workflows/pr_test.yaml index c13c716..ec36f39 100644 --- a/.github/workflows/pr_test.yaml +++ b/.github/workflows/pr_test.yaml @@ -7,6 +7,7 @@ on: jobs: build: + if: github.event.pull_request.labels.*.name != 'skip-build' uses: ./.github/workflows/_build.yaml with: NODE_VERSION: 20.x diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml new file mode 100644 index 0000000..c464571 --- /dev/null +++ b/.github/workflows/preview.yml @@ -0,0 +1,26 @@ +name: Vercel Preview Deployment +env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} +on: + push: + branches-ignore: + - main + + pull_request: + types: [opened, synchronize, reopened, labeled, unlabeled] + +jobs: + Deploy-Preview: + if: github.event.pull_request.labels.*.name != 'skip-build' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install Vercel CLI + run: npm install --global vercel@latest + - name: Pull Vercel Environment Information + run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} + - name: Build Project Artifacts + run: vercel build --token=${{ secrets.VERCEL_TOKEN }} + - name: Deploy Project Artifacts to Vercel + run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}