diff --git a/.github/workflows/on-pull-request-close.yml b/.github/workflows/on-pull-request-close.yml new file mode 100644 index 0000000..3e1f1e0 --- /dev/null +++ b/.github/workflows/on-pull-request-close.yml @@ -0,0 +1,18 @@ +name: Feature Branch + +on: + pull_request: + types: + - closed + +concurrency: preview-${{ github.ref }} + +jobs: + clean-deployment: + if: github.event.action == 'closed' && github.event.pull_request.draft == false + runs-on: ubuntu-20.04 + steps: + - name: Deploy preview + uses: rossjrw/pr-preview-action@v1 + with: + custom-url: percoct-ui.yld.engineering diff --git a/.github/workflows/on-pull-request.yml b/.github/workflows/on-pull-request.yml index 891fdaf..cf907f7 100644 --- a/.github/workflows/on-pull-request.yml +++ b/.github/workflows/on-pull-request.yml @@ -26,6 +26,7 @@ jobs: deployment: runs-on: ubuntu-20.04 needs: ["build"] + if: github.event.action != 'closed' && github.event.pull_request.draft == false environment: name: github-pages url: ${{ steps.preview.outputs.deployment-url }} @@ -33,13 +34,11 @@ jobs: environment_url: ${{ steps.preview.outputs.deployment-url }} steps: - name: Checkout - if: github.event.action != 'closed' && github.event.pull_request.draft == false uses: actions/checkout@v4 with: fetch-depth: 0 - uses: actions/download-artifact@v4 - if: github.event.action != 'closed' && github.event.pull_request.draft == false with: name: storybook-static path: ./storybook-static/