From 899a91a254dea402f930d93aa122c73be918bfa0 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sun, 16 Mar 2025 12:07:43 -0600 Subject: [PATCH] chore: refactor build preview workflow for improved clarity and efficiency - Renamed job from "build-and-deploy" to "build-preview" for better clarity. - Added concurrency settings to manage workflow runs effectively. - Streamlined steps by removing unnecessary commands and comments. - Updated pnpm action to the latest version and ensured proper Node.js versioning. --- .github/workflows/build-preview.yml | 37 ++++++++--------------------- 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build-preview.yml b/.github/workflows/build-preview.yml index 1e8a89c4..60142ccb 100644 --- a/.github/workflows/build-preview.yml +++ b/.github/workflows/build-preview.yml @@ -1,26 +1,23 @@ name: Build Preview Deployment +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.sha }} + cancel-in-progress: true + on: pull_request: types: [opened, synchronize] jobs: - build-and-deploy: + build-preview: runs-on: ubuntu-latest - name: Build and Deploy Preview steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 with: - node-version: '20' - - - name: Setup pnpm - uses: pnpm/action-setup@v2 - with: - version: 8 + node-version: 20 + cache: pnpm - name: Install dependencies working-directory: app @@ -29,10 +26,6 @@ jobs: - name: Build working-directory: app run: pnpm build - - - name: List build output - run: ls -la app/dist - # - name: Deploy to Cloudflare Pages # uses: AdrianGonz97/refined-cf-pages-action@v1 # with: @@ -44,17 +37,7 @@ jobs: # directory: app/dist - name: Upload build artifact - id: upload-artifact uses: actions/upload-artifact@v4 with: name: preview-build path: app/dist - retention-days: 1 - - # - name: Verify artifact upload - # run: | - # echo "Artifact upload completed" - # echo "Workflow ID: ${{ github.run_id }}" - # echo "Repository: ${{ github.repository }}" - # echo "Event name: ${{ github.event_name }}" - # echo "Event type: ${{ github.event.action }}" \ No newline at end of file