From 700f6ef6e6340e3fdf16f1b0ee12cc8175657579 Mon Sep 17 00:00:00 2001 From: Gavin Barron Date: Tue, 21 Nov 2023 06:54:56 -0800 Subject: [PATCH] chore: re-work cleanup pipeline (#2869) --- .github/workflows/pr-clean-deployments.yml | 37 +++++++--------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/.github/workflows/pr-clean-deployments.yml b/.github/workflows/pr-clean-deployments.yml index f92d8a88de..af0d950bed 100644 --- a/.github/workflows/pr-clean-deployments.yml +++ b/.github/workflows/pr-clean-deployments.yml @@ -9,8 +9,8 @@ on: branches: [main, release/**, next/**] jobs: - storybook: - if: "contains(github.event.pull_request.labels.*.name, 'Build: Storybook')" + cleanup: + if: "contains(github.event.pull_request.labels.*.name, 'Build: Storybook') || contains(github.event.pull_request.labels.*.name, 'Build: React Contoso')" runs-on: ubuntu-latest strategy: @@ -26,33 +26,20 @@ jobs: with: node-version: ${{ matrix.node-version }} registry-url: 'https://registry.npmjs.org' - - run: | + - name: Setup git user + run: | git config user.name github-actions git config user.email github-actions@github.com + - name: Remove pr storybook deployment + if: "contains(github.event.pull_request.labels.*.name, 'Build: Storybook')" + run: | git rm -r next/pr/${{ github.event.number }} git commit -m "PR ${{ github.event.number }} closed - remove storybook" - git push - - react-contoso: - if: "contains(github.event.pull_request.labels.*.name, 'Build: React Contoso')" - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [18.x] - - steps: - - uses: actions/checkout@v4 - with: - ref: gh-pages - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - registry-url: 'https://registry.npmjs.org' - - run: | - git config user.name github-actions - git config user.email github-actions@github.com + - name: Remove pr test app deployment + if: "contains(github.event.pull_request.labels.*.name, 'Build: React Contoso')" + run: | git rm -r next/sample/pr/${{ github.event.number }} git commit -m "PR ${{ github.event.number }} closed - remove react-contoso" + - name: Push changes + run: | git push