feat(carousel): 优化宽、高计算不精确,下一区域会漏出1-2像素问题 #177
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PR Preview | |
on: pull_request | |
jobs: | |
setup: | |
name: Setup | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@master | |
- name: Cache lerna | |
id: cache | |
uses: actions/cache@v2 | |
with: | |
path: | | |
node_modules | |
*/*/node_modules | |
key: ${{ runner.os }}-lerna-${{ hashFiles('**/yarn.lock') }} | |
- name: Install | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: yarn | |
compile-cli: | |
name: Compile @zarm-design/cli | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@master | |
- name: Restore lerna | |
uses: actions/cache@v2 | |
with: | |
path: | | |
node_modules | |
*/*/node_modules | |
key: ${{ runner.os }}-lerna-${{ hashFiles('**/yarn.lock') }} | |
- name: Cache @zarm-design/cli | |
uses: actions/cache@v2 | |
with: | |
path: packages/zarm-cli/lib | |
key: ${{ runner.os }}-cli-${{ github.sha }} | |
- name: Compile @zarm-design/cli | |
run: lerna exec --scope @zarm-design/cli -- yarn build | |
needs: setup | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@master | |
- name: Restore lerna | |
uses: actions/cache@v2 | |
with: | |
path: | | |
node_modules | |
*/*/node_modules | |
key: ${{ runner.os }}-lerna-${{ hashFiles('**/yarn.lock') }} | |
- name: Restore @zarm-design/cli | |
uses: actions/cache@v2 | |
with: | |
path: packages/zarm-cli/lib | |
key: ${{ runner.os }}-cli-${{ github.sha }} | |
- name: Cache assets | |
uses: actions/cache@v2 | |
with: | |
path: packages/site/assets | |
key: ${{ runner.os }}-assets-${{ github.sha }} | |
- name: Deploy Build | |
run: yarn deploy:build | |
needs: compile-cli | |
deploy: | |
name: Deploy Preview | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@master | |
- name: Restore assets | |
uses: actions/cache@v2 | |
with: | |
path: packages/site/assets | |
key: ${{ runner.os }}-assets-${{ github.sha }} | |
- name: Upload Surge Service | |
id: deploy | |
run: | | |
export DEPLOY_DOMAIN=https://preview-${{ github.event.number }}-zarm-design.surge.sh | |
npx surge --project ./packages/site/assets --domain $DEPLOY_DOMAIN --token ${{ secrets.SURGE_TOKEN }} | |
needs: build | |
comment: | |
name: Update Status Comment | |
runs-on: ubuntu-latest | |
steps: | |
- name: Comment Preview URL | |
uses: actions-cool/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
body: | | |
[https://preview-${{ github.event.number }}-zarm-design.surge.sh](https://preview-${{ github.event.number }}-zarm-design.surge.sh) | |
<!-- AUTO_PREVIEW_HOOK --> | |
body-include: '<!-- AUTO_PREVIEW_HOOK -->' | |
number: ${{ github.event.number }} | |
- name: Comment For Failed | |
if: ${{ failure() }} | |
uses: actions-cool/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
body: | | |
Preview Site Deploy Failed! | |
<!-- AUTO_PREVIEW_HOOK --> | |
body-include: '<!-- AUTO_PREVIEW_HOOK -->' | |
number: ${{ github.event.number }} | |
needs: deploy |