Skip to content

Commit

Permalink
ci: fix formatting (#51971)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wxh16144 authored Dec 14, 2024
1 parent 88bf8bc commit 48f85d6
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions .github/workflows/site-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ jobs:
build-site:
runs-on: ubuntu-latest
if: (startsWith(github.ref, 'refs/tags/') && (contains(github.ref_name, '-') == false)) || github.event_name == 'workflow_dispatch'

# https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#example-defining-outputs-for-a-job
outputs:
formatted_version: ${{ steps.shared-formatted_version.outputs.VERSION }}

steps:
- name: checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -46,6 +51,11 @@ jobs:
path: _site/
retention-days: 1 # Not need to keep for too long

- name: Format version
if: ${{ always() }}
id: shared-formatted_version
run: echo "VERSION=$(echo ${{ github.ref_name }} | sed 's/\./-/g')" >> $GITHUB_OUTPUT

deploy-to-pages:
runs-on: ubuntu-latest
needs: build-site
Expand All @@ -58,10 +68,6 @@ jobs:
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:
Expand All @@ -81,15 +87,15 @@ jobs:

- name: Deploy to Surge (with TAG)
run: |
export DEPLOY_DOMAIN=ant-design-${{ steps.publish-version.outputs.VERSION }}.surge.sh
export DEPLOY_DOMAIN=ant-design-${{ needs.build-site.outputs.formatted_version }}.surge.sh
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
- Documentation site for this release: https://ant-design-${{ needs.build-site.outputs.formatted_version }}.surge.sh
- Webpack bundle analyzer report page: https://ant-design-${{ needs.build-site.outputs.formatted_version }}.surge.sh/report.html
# https://github.com/ant-design/ant-design/pull/49213/files#r1625446496
upload-to-release:
Expand All @@ -107,8 +113,7 @@ jobs:
- name: Tarball site
run: |
cd ./_site
VERSION=$(echo ${{ github.ref_name }} | sed 's/\./-/g')
tar -czf ../website.tar.gz --transform 's|^|antd-${VERSION}-website/|' .
tar -czf ../website.tar.gz --transform 's|^|antd-${{ needs.build-site.outputs.formatted_version }}-website/|' .
cd ..
- name: Upload to Release
Expand Down

0 comments on commit 48f85d6

Please sign in to comment.