From 6ed78896bb5fa95548fec04bfacc94ea201f3415 Mon Sep 17 00:00:00 2001 From: marginy <98329176+Marginy605@users.noreply.github.com> Date: Mon, 23 Jan 2023 18:57:30 +0300 Subject: [PATCH] ci: add preview workflow (#112) --- .github/workflows/pr-preview-build.yml | 13 +++++++++++++ .github/workflows/pr-preview-deploy.yml | 22 ++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 .github/workflows/pr-preview-build.yml create mode 100644 .github/workflows/pr-preview-deploy.yml diff --git a/.github/workflows/pr-preview-build.yml b/.github/workflows/pr-preview-build.yml new file mode 100644 index 00000000..7597a14a --- /dev/null +++ b/.github/workflows/pr-preview-build.yml @@ -0,0 +1,13 @@ +name: PR Preview Build + +on: + pull_request: + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: gravity-ui/preview-build-action@v1 + env: + TS_NODE_PROJECT: .storybook/tsconfig.json diff --git a/.github/workflows/pr-preview-deploy.yml b/.github/workflows/pr-preview-deploy.yml new file mode 100644 index 00000000..8a6efc28 --- /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@v1 + with: + project: chartkit + github-token: ${{ secrets.GRAVITY_UI_BOT_GITHUB_TOKEN }} + s3-key-id: ${{ secrets.STORYBOOK_S3_KEY_ID }} + s3-secret-key: ${{ secrets.STORYBOOK_S3_SECRET_KEY }}