Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(workflow): pull request jobs #50

Merged
merged 3 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 38 additions & 33 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,44 @@
name: MAIN_PULL_REQUEST

on:
push:
branches: [main]
pull_request_target:
types: [closed]
# push:
# branches: [main]
# pull_request_target:
# types: [closed]
pull_request:
branches: [develop, main, compositionAPI]
types: [opened, synchronize, reopened]

jobs:
modify-services:
runs-on: ubuntu-latest
outputs:
services-changed: ${{ steps.services-changed.outputs.changed }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 100
- uses: marceloprado/has-changed-path@v1
id: services-changed
with:
paths: services
- run: echo services changed=${{ steps.services-changed.outputs.changed }}
call-test-build:
uses: .github/workflows/test-build.yml
# modify-services:
# runs-on: ubuntu-latest
# outputs:
# services-changed: ${{ steps.services-changed.outputs.changed }}
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 100
# - uses: marceloprado/has-changed-path@v1
# id: services-changed
# with:
# paths: services
# - run: echo services changed=${{ steps.services-changed.outputs.changed }}

upload-services:
runs-on: ubuntu-latest
needs: modify-services
if: needs.modify-services.outputs.services-changed == 'true'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18
- run: node ./services/update-components-notice.js
- run: sleep 3s
- run: |
export DEPLOY_DOMAIN=https://tdesign-site-services.surge.sh
npx surge --project ./services --domain $DEPLOY_DOMAIN --token ${{ secrets.TDESIGN_SURGE_TOKEN }}
echo the preview URL is $DEPLOY_DOMAIN
echo "::set-output name=url::$DEPLOY_DOMAIN"
# upload-services:
# runs-on: ubuntu-latest
# needs: modify-services
# if: needs.modify-services.outputs.services-changed == 'true'
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v2
# with:
# node-version: 18
# - run: node ./services/update-components-notice.js
# - run: sleep 3s
# - run: |
# export DEPLOY_DOMAIN=https://tdesign-site-services.surge.sh
# npx surge --project ./services --domain $DEPLOY_DOMAIN --token ${{ secrets.TDESIGN_SURGE_TOKEN }}
# echo the preview URL is $DEPLOY_DOMAIN
# echo "::set-output name=url::$DEPLOY_DOMAIN"
11 changes: 5 additions & 6 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ jobs:
${{ runner.os }}-build-
${{ runner.os }}-
- run: npm install

- run: npm run lint
- run: npm run test
- run: npm run build
# - run: npm run test
# upload report to codecov
- uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
# - uses: codecov/codecov-action@v2
# with:
# token: ${{ secrets.CODECOV_TOKEN }}

site:
runs-on: ubuntu-latest
Expand All @@ -68,7 +68,6 @@ jobs:
${{ runner.os }}-build-
${{ runner.os }}-
- run: npm install

- name: Build site
run: npm run site:preview

Expand Down
Loading