mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-21 13:18:04 +08:00
670677d24d
Some checks are pending
Publish Any Commit / build (push) Waiting to run
🔀 Sync mirror to Gitee / mirror (push) Waiting to run
✅ test / lint (push) Waiting to run
✅ test / test-react-legacy (16, 1/2) (push) Waiting to run
✅ test / test-react-legacy (16, 2/2) (push) Waiting to run
✅ test / test-react-legacy (17, 1/2) (push) Waiting to run
✅ test / test-react-legacy (17, 2/2) (push) Waiting to run
✅ test / test-node (push) Waiting to run
✅ test / test-react-latest (dom, 1/2) (push) Waiting to run
✅ test / test-react-latest (dom, 2/2) (push) Waiting to run
✅ test / test-react-latest-dist (dist, 1/2) (push) Blocked by required conditions
✅ test / test-react-latest-dist (dist, 2/2) (push) Blocked by required conditions
✅ test / test-react-latest-dist (dist-min, 1/2) (push) Blocked by required conditions
✅ test / test-react-latest-dist (dist-min, 2/2) (push) Blocked by required conditions
✅ test / test-coverage (push) Blocked by required conditions
✅ test / build (push) Waiting to run
✅ test / test lib/es module (es, 1/2) (push) Waiting to run
✅ test / test lib/es module (es, 2/2) (push) Waiting to run
✅ test / test lib/es module (lib, 1/2) (push) Waiting to run
✅ test / test lib/es module (lib, 2/2) (push) Waiting to run
👁️ Visual Regression Persist Start / test image (push) Waiting to run
109 lines
3.3 KiB
YAML
109 lines
3.3 KiB
YAML
# When pushing a tag. this workflow will trigger site deployment and fixed version address comments
|
|
|
|
name: Deploy website
|
|
on:
|
|
push:
|
|
tags:
|
|
- '5.*'
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build-site:
|
|
runs-on: ubuntu-latest
|
|
if: (startsWith(github.ref, 'refs/tags/') && (contains(github.ref_name, '-') == false)) || github.event_name == 'workflow_dispatch'
|
|
steps:
|
|
- name: checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- uses: oven-sh/setup-bun@v2
|
|
|
|
- run: bun install
|
|
|
|
- name: build site
|
|
run: bun run predeploy
|
|
env:
|
|
NODE_OPTIONS: --max_old_space_size=4096
|
|
|
|
- name: build dist and bundle analyzer report
|
|
run: bun run dist
|
|
env:
|
|
ANALYZER: 1
|
|
NODE_OPTIONS: --max_old_space_size=4096
|
|
|
|
- name: upload site artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: real-site
|
|
path: _site/
|
|
retention-days: 1 # Not need to keep for too long
|
|
|
|
deploy-to-pages:
|
|
runs-on: ubuntu-latest
|
|
needs: build-site
|
|
steps:
|
|
- name: download site artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: real-site
|
|
path: _site
|
|
|
|
- name: Get version
|
|
id: publish-version
|
|
run: echo "VERSION=$(echo ${{ github.ref_name }} | sed 's/\./-/g')" >> $GITHUB_OUTPUT
|
|
|
|
- name: Deploy to GitHub Pages
|
|
uses: peaceiris/actions-gh-pages@v4
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_dir: ./_site
|
|
force_orphan: true
|
|
|
|
# Since force_orphan will not trigger Sync to Gitee, we need to force run it here
|
|
- name: Sync to Gitee
|
|
uses: wearerequired/git-mirror-action@v1
|
|
env:
|
|
SSH_PRIVATE_KEY: ${{ secrets.GITEE_SSH_PRIVATE_KEY }}
|
|
with:
|
|
source-repo: 'git@github.com:ant-design/ant-design.git'
|
|
destination-repo: 'git@gitee.com:ant-design/ant-design.git'
|
|
|
|
- name: Deploy to Surge (with TAG)
|
|
run: |
|
|
export DEPLOY_DOMAIN=ant-design-${{ steps.publish-version.outputs.VERSION }}.surge.sh
|
|
cp report.html ./_site
|
|
bunx surge --project ./_site --domain $DEPLOY_DOMAIN --token ${{ secrets.SURGE_TOKEN }}
|
|
|
|
- name: Create Commit Comment
|
|
uses: peter-evans/commit-comment@v3
|
|
with:
|
|
body: |
|
|
- Documentation site for this release: https://ant-design-${{ steps.publish-version.outputs.VERSION }}.surge.sh
|
|
- Webpack bundle analyzer report page: https://ant-design-${{ steps.publish-version.outputs.VERSION }}.surge.sh/report.html
|
|
|
|
# https://github.com/ant-design/ant-design/pull/49213/files#r1625446496
|
|
upload-to-release:
|
|
runs-on: ubuntu-latest
|
|
needs: build-site
|
|
steps:
|
|
- name: download site artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: real-site
|
|
path: _site
|
|
|
|
- name: Tarball site
|
|
run: |
|
|
cd ./_site
|
|
VERSION=$(echo ${{ github.ref_name }} | sed 's/\./-/g')
|
|
tar -czf ../website.tar.gz --transform 's|^|antd-${VERSION}-website/|' .
|
|
cd ..
|
|
|
|
- name: Upload to Release
|
|
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8
|
|
with:
|
|
fail_on_unmatched_files: true
|
|
files: website.tar.gz
|