mirror of
https://github.com/Dokploy/templates
synced 2025-06-26 18:16:07 +00:00
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.
This commit is contained in:
37
.github/workflows/build-preview.yml
vendored
37
.github/workflows/build-preview.yml
vendored
@@ -1,26 +1,23 @@
|
|||||||
name: Build Preview Deployment
|
name: Build Preview Deployment
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, synchronize]
|
types: [opened, synchronize]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-deploy:
|
build-preview:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Build and Deploy Preview
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- uses: actions/checkout@v4
|
||||||
uses: actions/checkout@v4
|
- uses: pnpm/action-setup@v4
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
- name: Setup Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
node-version: 20
|
||||||
|
cache: pnpm
|
||||||
- name: Setup pnpm
|
|
||||||
uses: pnpm/action-setup@v2
|
|
||||||
with:
|
|
||||||
version: 8
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
working-directory: app
|
working-directory: app
|
||||||
@@ -29,10 +26,6 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
working-directory: app
|
working-directory: app
|
||||||
run: pnpm build
|
run: pnpm build
|
||||||
|
|
||||||
- name: List build output
|
|
||||||
run: ls -la app/dist
|
|
||||||
|
|
||||||
# - name: Deploy to Cloudflare Pages
|
# - name: Deploy to Cloudflare Pages
|
||||||
# uses: AdrianGonz97/refined-cf-pages-action@v1
|
# uses: AdrianGonz97/refined-cf-pages-action@v1
|
||||||
# with:
|
# with:
|
||||||
@@ -44,17 +37,7 @@ jobs:
|
|||||||
# directory: app/dist
|
# directory: app/dist
|
||||||
|
|
||||||
- name: Upload build artifact
|
- name: Upload build artifact
|
||||||
id: upload-artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: preview-build
|
name: preview-build
|
||||||
path: app/dist
|
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 }}"
|
|
||||||
Reference in New Issue
Block a user