diff --git a/.github/workflows/pr-preview-build.yml b/.github/workflows/pr-preview-build.yml index ba0ad57..db0b617 100644 --- a/.github/workflows/pr-preview-build.yml +++ b/.github/workflows/pr-preview-build.yml @@ -1,4 +1,4 @@ -name: PR Preview +name: PR Preview Build on: pull_request: @@ -10,15 +10,4 @@ jobs: steps: - uses: gravity-ui/preview-build-action@v2 with: - node-version: 18 - deploy: - name: Deploy - needs: build - runs-on: ubuntu-latest - steps: - - uses: gravity-ui/preview-deploy-action@v2 - with: - project: graph - github-token: ${{ secrets.GRAVITY_UI_BOT_GITHUB_TOKEN }} - s3-key-id: ${{ secrets.STORYBOOK_S3_KEY_ID }} - s3-secret-key: ${{ secrets.STORYBOOK_S3_SECRET_KEY }} \ No newline at end of file + node-version: 18 \ No newline at end of file diff --git a/.github/workflows/pr-preview-deploy.yml b/.github/workflows/pr-preview-deploy.yml new file mode 100644 index 0000000..74db3e8 --- /dev/null +++ b/.github/workflows/pr-preview-deploy.yml @@ -0,0 +1,22 @@ +name: PR Preview Deploy + +on: + workflow_run: + workflows: ['PR Preview Build'] + types: + - completed + +jobs: + deploy: + name: Deploy + if: > + github.event.workflow_run.event == 'pull_request' && + github.event.workflow_run.conclusion == 'success' + runs-on: ubuntu-latest + steps: + - uses: gravity-ui/preview-deploy-action@v2 + with: + project: graph + github-token: ${{ secrets.GRAVITY_UI_BOT_GITHUB_TOKEN }} + s3-key-id: ${{ secrets.STORYBOOK_S3_KEY_ID }} + s3-secret-key: ${{ secrets.STORYBOOK_S3_SECRET_KEY }} \ No newline at end of file