From 06bf242696bc12582c46a6da4daafccea18c5f20 Mon Sep 17 00:00:00 2001 From: Daniel Leroux Date: Tue, 19 Mar 2024 07:54:00 +0100 Subject: [PATCH] ci: combine workflow files --- .github/workflows/deploy-preview.yml | 41 ---------------------------- .github/workflows/pr.yml | 22 +++++++++++++++ 2 files changed, 22 insertions(+), 41 deletions(-) delete mode 100644 .github/workflows/deploy-preview.yml diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml deleted file mode 100644 index 095c1151211..00000000000 --- a/.github/workflows/deploy-preview.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Deploy Preview - -on: - pull_request: - types: [opened, synchronize, reopened, labeled] - -jobs: - netlify: - runs-on: ubuntu-latest - steps: - - name: Build - uses: netlify/actions/cli@master - with: - args: build - env: - NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} - NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - - - name: Publish - id: publish - uses: netlify/actions/cli@master - with: - args: deploy - env: - NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} - NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - - - name: Debug output - shell: bash - run: | - echo ${{ steps.publish.outputs.NETLIFY_URL }} - # - name: Deploy Preview for PR - # if: contains(github.event.pull_request.labels.*.name, 'Deploy Preview') - # uses: actions-cool/issues-helper@v3 - # with: - # issue-number: ${{ github.event.pull_request.number }} - # actions: 'create-comment' - # token: ${{ secrets.GITHUB_TOKEN }} - # body: | - # 📡 PR Preview Deployment - diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 70146135190..341a59560c1 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -8,6 +8,7 @@ on: - opened - reopened - synchronize + - labeled concurrency: pr-${{ github.ref }} @@ -125,6 +126,7 @@ jobs: name: core-html-report--attempt-${{ github.run_attempt }} path: playwright-report retention-days: 2 + unit: if: ${{ needs.changes.outputs.core == 'true' || needs.changes.outputs.angular == 'true' }} needs: [build] @@ -138,3 +140,23 @@ jobs: - name: Test run: pnpm run test --cache-dir=.turbo --filter !\documentation + + deploy-preview: + if: ${{ contains(github.event.pull_request.labels.*.name, 'Deploy Preview') }} + steps: + - name: Checkout + uses: actions/checkout@v3 + + - uses: ./.github/workflows/actions/turbo + + - name: Build + run: pnpm build --cache-dir=.turbo --filter documentation + + - name: Publish + id: publish + uses: netlify/actions/cli@master + with: + args: deploy + env: + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}