Skip to content

Commit

Permalink
feat: consolidate site build jobs into a single concurrent step in Gi…
Browse files Browse the repository at this point in the history
…tHub Actions workflow
  • Loading branch information
adaex committed Nov 25, 2024
1 parent 9b898c4 commit e62b883
Showing 1 changed file with 7 additions and 29 deletions.
36 changes: 7 additions & 29 deletions .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main

jobs:
checkout-install:
build-and-deploy:
runs-on: ubuntu-latest

steps:
Expand All @@ -24,37 +24,15 @@ jobs:
- name: Set ARCO_SITE_DOMAIN
run: echo "ARCO_SITE_DOMAIN=preview-${{ github.event.number }}-arco-design-mobile.surge.sh" >> $GITHUB_ENV

build-home:
runs-on: ubuntu-latest
needs: checkout-install
steps:
- name: Build site:home
run: npm run site:home
env:
ARCO_SITE_DOMAIN: ${{ env.ARCO_SITE_DOMAIN }}

build-pc:
runs-on: ubuntu-latest
needs: checkout-install
steps:
- name: Build site:pc
run: npm run site:pc
env:
ARCO_SITE_DOMAIN: ${{ env.ARCO_SITE_DOMAIN }}

build-mobile:
runs-on: ubuntu-latest
needs: checkout-install
steps:
- name: Build site:mobile
run: npm run site:mobile
- name: Build sites concurrently
run: |
npm run site:home &
npm run site:pc &
npm run site:mobile &
wait
env:
ARCO_SITE_DOMAIN: ${{ env.ARCO_SITE_DOMAIN }}

merge-and-deploy:
runs-on: ubuntu-latest
needs: [build-home, build-pc, build-mobile]
steps:
- name: Merge output directories
run: |
# 合并文件
Expand Down

0 comments on commit e62b883

Please sign in to comment.