From 5e8e466b2f44124aa68a5616ddebf40434ce892e Mon Sep 17 00:00:00 2001 From: Masoud Amjadi Date: Tue, 8 Nov 2022 12:45:53 -0500 Subject: [PATCH] feat(github): using new workflow_run feature to trigger storybook tests workflow (#282) --- .github/workflows/storybook-tests.yml | 9 ++++++--- .github/workflows/storybook.yml | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/storybook-tests.yml b/.github/workflows/storybook-tests.yml index 17241e507..29d1e96e7 100644 --- a/.github/workflows/storybook-tests.yml +++ b/.github/workflows/storybook-tests.yml @@ -1,10 +1,13 @@ name: Storybook Tests -on: deployment_status +on: + workflow_run: + workflows: ["Build and Deploy"] + type: + - complete jobs: test: timeout-minutes: 60 runs-on: ubuntu-latest - if: github.event.deployment_status.state == 'success' steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 @@ -15,4 +18,4 @@ jobs: - name: Run Storybook tests run: yarn test-storybook env: - TARGET_URL: "${{ github.event.deployment_status.target_url }}" + TARGET_URL: "https://chanzuckerberg.github.io/sci-components" diff --git a/.github/workflows/storybook.yml b/.github/workflows/storybook.yml index 6e38bb3df..06031227e 100644 --- a/.github/workflows/storybook.yml +++ b/.github/workflows/storybook.yml @@ -19,7 +19,7 @@ jobs: - name: Deploy 🚀 uses: JamesIves/github-pages-deploy-action@v4 with: - GITHUB_TOKEN: ${{ secrets.DEPLOY_AND_TESTS }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} BRANCH: gh-pages # The branch the action should deploy to. FOLDER: docs-build # The folder that the build-storybook script generates files. CLEAN: true # Automatically remove deleted files from the deploy branch