From 02c9fe3406415d53b0af7696510a1ac2f708091f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20Sch=C3=BCrch?= Date: Thu, 11 Jul 2024 07:43:23 +0200 Subject: [PATCH] chore(workflows): align demo workflows --- .github/workflows/build-demo.yaml | 15 +++++++-------- .github/workflows/deploy-demo.yaml | 13 ++++++++----- .github/workflows/release-demo.yaml | 4 ++-- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build-demo.yaml b/.github/workflows/build-demo.yaml index e46ce19658..1d8c7b52be 100644 --- a/.github/workflows/build-demo.yaml +++ b/.github/workflows/build-demo.yaml @@ -1,19 +1,13 @@ ### # -# Build the demo app and all dependencies -# -# This workflow does not have secrets access -# when run from a fork. Artifacts are uploaded -# and used in a subsequent workflow with more -# privileges which does not run unsafe commands. -# -# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ +# DEPRECATED: This Action can be removed as soon as we start working on V2/V9 # ### name: Build Demo App on: pull_request: + types: [opened, synchronize, edited, reopened] paths: - 'packages/intranet-header-workspace/**' - 'packages/demo/**' @@ -29,6 +23,11 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Create preview message + uses: ./.github/actions/preview/message/create + with: + access-token: ${{ secrets.SWISSPOSTDEVS_ACCESS_TOKEN }} + - name: Setup uses: ./.github/actions/setup-pnpm diff --git a/.github/workflows/deploy-demo.yaml b/.github/workflows/deploy-demo.yaml index 15d749fada..2e23a6ee6d 100644 --- a/.github/workflows/deploy-demo.yaml +++ b/.github/workflows/deploy-demo.yaml @@ -1,8 +1,6 @@ ### # -# Deploys a pre-built demo app to netlify -# -# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ +# DEPRECATED: This Action can be removed as soon as we start working on V2/V9 # ### @@ -45,6 +43,11 @@ jobs: netlify_site_id: ${{ secrets.NETLIFY_SITE_ID }} netlify_site_url: swisspost-web-frontend.netlify.app folder: ${{ steps.build.outputs.folder }} - comment_token: ${{ secrets.SWISSPOSTDEVS_ACCESS_TOKEN }} - comment_author: swisspost-bot package_name: '@swisspost/design-system-demo' + + - name: Update preview message + uses: ./.github/actions/preview/message/update + with: + access-token: ${{ secrets.SWISSPOSTDEVS_ACCESS_TOKEN }} + issue-number: ${{ steps.build.outputs.id }} + preview-url: ${{ steps.deploy.outputs.preview-url }} diff --git a/.github/workflows/release-demo.yaml b/.github/workflows/release-demo.yaml index 18efade0cf..a0f283a85b 100644 --- a/.github/workflows/release-demo.yaml +++ b/.github/workflows/release-demo.yaml @@ -1,6 +1,6 @@ ### # -# Release the demo app whenever it's package json changes on the main branch +# DEPRECATED: This Action can be removed as soon as we start working on V2/V9 # ### @@ -47,7 +47,7 @@ jobs: - name: Install netlify cli if: steps.check.outputs.changed == 'true' - run: pnpm -g i netlify-cli@15 + run: pnpm -g i netlify-cli@17 # Publish demo only if changesets published any packages - name: Publish demo app to netlify