From 0a08d576dde4a22707fbd11c308a1ebc7c4cac09 Mon Sep 17 00:00:00 2001 From: barsnes Date: Mon, 16 Sep 2024 09:54:30 +0200 Subject: [PATCH 1/5] chore: only run theme preview on changes in theme folder --- .github/workflows/preview-theme.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/preview-theme.yml b/.github/workflows/preview-theme.yml index 757e8559a1..810698ce0c 100644 --- a/.github/workflows/preview-theme.yml +++ b/.github/workflows/preview-theme.yml @@ -9,9 +9,7 @@ on: pull_request: types: [opened, synchronize] paths: - - 'packages/**' - 'apps/theme/**' - - 'assets/**' jobs: Deploy-Preview: runs-on: ubuntu-latest @@ -84,11 +82,14 @@ jobs: issue-number: ${{ env.PR_NUMBER }} comment-id: ${{ steps.fc.outputs.comment-id }} edit-mode: replace + reactions: rocket, eyes body: | - ## Preview deployments + **Preview deployments for this pull request:** ${{ steps.regex-storybook.outputs.match }} [Theme](https://pr-${{ env.PR_NUMBER }}.theme.designsystemet.no) `${{ steps.current-time.outputs.formattedTime }} (Norwegian time)` ${{ steps.regex-storefront.outputs.match }} + + See all deployments at [https://dev.designsystemet.no](https://dev.designsystemet.no) From bbf2f418d6383a37a16b568efa173019509da4fc Mon Sep 17 00:00:00 2001 From: barsnes Date: Mon, 16 Sep 2024 09:56:49 +0200 Subject: [PATCH 2/5] theme regex --- .github/workflows/preview-storefront.yml | 9 +++++++++ .github/workflows/preview-storybook.yml | 9 +++++++++ .github/workflows/preview-theme.yml | 10 +++++++++- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/preview-storefront.yml b/.github/workflows/preview-storefront.yml index 6cc72b6b5b..417171ff3e 100644 --- a/.github/workflows/preview-storefront.yml +++ b/.github/workflows/preview-storefront.yml @@ -62,6 +62,13 @@ jobs: text: ${{ steps.fc.outputs.comment-body }} regex: '📖 \[Storybook\]\((https:\/\/[^)]+)\) `[^`]+`' + - name: Find Theme deployment + uses: actions-ecosystem/action-regex-match@v2 + id: regex-theme + with: + text: ${{ steps.fc.outputs.comment-body }} + regex: '🖥 \[Theme\]\((https:\/\/[^)]+)\) `[^`]+`' + - name: Get current time in CEST uses: josStorer/get-current-time@v2 id: current-time @@ -81,6 +88,8 @@ jobs: ${{ steps.regex-storybook.outputs.match }} + ${{ steps.regex-theme.outputs.match }} + 🖥 [Storefront](https://storefront-pr-${{ env.PR_NUMBER }}.dev.designsystemet.no) `${{ steps.current-time.outputs.formattedTime }} (Norwegian time)` See all deployments at [https://dev.designsystemet.no](https://dev.designsystemet.no) diff --git a/.github/workflows/preview-storybook.yml b/.github/workflows/preview-storybook.yml index db5970f21c..1974c2ab5c 100644 --- a/.github/workflows/preview-storybook.yml +++ b/.github/workflows/preview-storybook.yml @@ -64,6 +64,13 @@ jobs: text: ${{ steps.fc.outputs.comment-body }} regex: '🖥 \[Storefront\]\((https:\/\/[^)]+)\) `[^`]+`' + - name: Find Theme deployment + uses: actions-ecosystem/action-regex-match@v2 + id: regex-theme + with: + text: ${{ steps.fc.outputs.comment-body }} + regex: '🖥 \[Theme\]\((https:\/\/[^)]+)\) `[^`]+`' + - name: Get current time in CEST uses: josStorer/get-current-time@v2 id: current-time @@ -85,4 +92,6 @@ jobs: ${{ steps.regex-storefront.outputs.match }} + ${{ steps.regex-theme.outputs.match }} + See all deployments at [https://dev.designsystemet.no](https://dev.designsystemet.no) diff --git a/.github/workflows/preview-theme.yml b/.github/workflows/preview-theme.yml index 810698ce0c..00c6f026e0 100644 --- a/.github/workflows/preview-theme.yml +++ b/.github/workflows/preview-theme.yml @@ -69,6 +69,13 @@ jobs: text: ${{ steps.fc.outputs.comment-body }} regex: '🖥 \[Storefront\]\((https:\/\/[^)]+)\) `[^`]+`' + - name: Find Theme deployment + uses: actions-ecosystem/action-regex-match@v2 + id: regex-theme + with: + text: ${{ steps.fc.outputs.comment-body }} + regex: '🖥 \[Theme\]\((https:\/\/[^)]+)\) `[^`]+`' + - name: Get current time in CEST uses: josStorer/get-current-time@v2 id: current-time @@ -88,8 +95,9 @@ jobs: ${{ steps.regex-storybook.outputs.match }} + ${{ steps.regex-theme.outputs.match }} + [Theme](https://pr-${{ env.PR_NUMBER }}.theme.designsystemet.no) `${{ steps.current-time.outputs.formattedTime }} (Norwegian time)` - ${{ steps.regex-storefront.outputs.match }} See all deployments at [https://dev.designsystemet.no](https://dev.designsystemet.no) From 987bb51a422ee52f06eaeb8b348291a28ead09ec Mon Sep 17 00:00:00 2001 From: barsnes Date: Mon, 16 Sep 2024 09:57:26 +0200 Subject: [PATCH 3/5] reorder --- .github/workflows/preview-storefront.yml | 4 ++-- .github/workflows/preview-theme.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/preview-storefront.yml b/.github/workflows/preview-storefront.yml index 417171ff3e..3a4c94aea6 100644 --- a/.github/workflows/preview-storefront.yml +++ b/.github/workflows/preview-storefront.yml @@ -88,8 +88,8 @@ jobs: ${{ steps.regex-storybook.outputs.match }} - ${{ steps.regex-theme.outputs.match }} - 🖥 [Storefront](https://storefront-pr-${{ env.PR_NUMBER }}.dev.designsystemet.no) `${{ steps.current-time.outputs.formattedTime }} (Norwegian time)` + ${{ steps.regex-theme.outputs.match }} + See all deployments at [https://dev.designsystemet.no](https://dev.designsystemet.no) diff --git a/.github/workflows/preview-theme.yml b/.github/workflows/preview-theme.yml index 00c6f026e0..6370f2486b 100644 --- a/.github/workflows/preview-theme.yml +++ b/.github/workflows/preview-theme.yml @@ -95,7 +95,7 @@ jobs: ${{ steps.regex-storybook.outputs.match }} - ${{ steps.regex-theme.outputs.match }} + ${{ steps.regex-storefront.outputs.match }} [Theme](https://pr-${{ env.PR_NUMBER }}.theme.designsystemet.no) `${{ steps.current-time.outputs.formattedTime }} (Norwegian time)` From aeeecda92b72cabeae404487e8b869766ae25fbe Mon Sep 17 00:00:00 2001 From: barsnes Date: Mon, 16 Sep 2024 10:51:32 +0200 Subject: [PATCH 4/5] update theme regex --- .github/workflows/preview-storefront.yml | 2 +- .github/workflows/preview-storybook.yml | 2 +- .github/workflows/preview-theme.yml | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/preview-storefront.yml b/.github/workflows/preview-storefront.yml index 3a4c94aea6..de3a7b410c 100644 --- a/.github/workflows/preview-storefront.yml +++ b/.github/workflows/preview-storefront.yml @@ -67,7 +67,7 @@ jobs: id: regex-theme with: text: ${{ steps.fc.outputs.comment-body }} - regex: '🖥 \[Theme\]\((https:\/\/[^)]+)\) `[^`]+`' + regex: '\[Theme\]\((https:\/\/[^)]+)\) `[^`]+`' - name: Get current time in CEST uses: josStorer/get-current-time@v2 diff --git a/.github/workflows/preview-storybook.yml b/.github/workflows/preview-storybook.yml index 1974c2ab5c..d1acfa4126 100644 --- a/.github/workflows/preview-storybook.yml +++ b/.github/workflows/preview-storybook.yml @@ -69,7 +69,7 @@ jobs: id: regex-theme with: text: ${{ steps.fc.outputs.comment-body }} - regex: '🖥 \[Theme\]\((https:\/\/[^)]+)\) `[^`]+`' + regex: '\[Theme\]\((https:\/\/[^)]+)\) `[^`]+`' - name: Get current time in CEST uses: josStorer/get-current-time@v2 diff --git a/.github/workflows/preview-theme.yml b/.github/workflows/preview-theme.yml index 6370f2486b..1005299720 100644 --- a/.github/workflows/preview-theme.yml +++ b/.github/workflows/preview-theme.yml @@ -74,7 +74,7 @@ jobs: id: regex-theme with: text: ${{ steps.fc.outputs.comment-body }} - regex: '🖥 \[Theme\]\((https:\/\/[^)]+)\) `[^`]+`' + regex: '\[Theme\]\((https:\/\/[^)]+)\) `[^`]+`' - name: Get current time in CEST uses: josStorer/get-current-time@v2 @@ -99,5 +99,4 @@ jobs: [Theme](https://pr-${{ env.PR_NUMBER }}.theme.designsystemet.no) `${{ steps.current-time.outputs.formattedTime }} (Norwegian time)` - See all deployments at [https://dev.designsystemet.no](https://dev.designsystemet.no) From a657e83fc4a382e006be6661836bf47687597792 Mon Sep 17 00:00:00 2001 From: barsnes Date: Mon, 16 Sep 2024 10:58:21 +0200 Subject: [PATCH 5/5] remove https://dev.designsystemet.no --- .github/workflows/preview-storefront.yml | 2 -- .github/workflows/preview-storybook.yml | 2 -- .github/workflows/preview-theme.yml | 2 -- 3 files changed, 6 deletions(-) diff --git a/.github/workflows/preview-storefront.yml b/.github/workflows/preview-storefront.yml index de3a7b410c..3c058181c1 100644 --- a/.github/workflows/preview-storefront.yml +++ b/.github/workflows/preview-storefront.yml @@ -91,5 +91,3 @@ jobs: 🖥 [Storefront](https://storefront-pr-${{ env.PR_NUMBER }}.dev.designsystemet.no) `${{ steps.current-time.outputs.formattedTime }} (Norwegian time)` ${{ steps.regex-theme.outputs.match }} - - See all deployments at [https://dev.designsystemet.no](https://dev.designsystemet.no) diff --git a/.github/workflows/preview-storybook.yml b/.github/workflows/preview-storybook.yml index d1acfa4126..0d1b7ec423 100644 --- a/.github/workflows/preview-storybook.yml +++ b/.github/workflows/preview-storybook.yml @@ -93,5 +93,3 @@ jobs: ${{ steps.regex-storefront.outputs.match }} ${{ steps.regex-theme.outputs.match }} - - See all deployments at [https://dev.designsystemet.no](https://dev.designsystemet.no) diff --git a/.github/workflows/preview-theme.yml b/.github/workflows/preview-theme.yml index 1005299720..35d84ff516 100644 --- a/.github/workflows/preview-theme.yml +++ b/.github/workflows/preview-theme.yml @@ -98,5 +98,3 @@ jobs: ${{ steps.regex-storefront.outputs.match }} [Theme](https://pr-${{ env.PR_NUMBER }}.theme.designsystemet.no) `${{ steps.current-time.outputs.formattedTime }} (Norwegian time)` - - See all deployments at [https://dev.designsystemet.no](https://dev.designsystemet.no)