ci: update site-deploy.yml (#39312)

* ci: add doc-site workflow

* ci: Add Manual Trigger Action

* ci: update site-deploy.yml

Modify trigger events

Add Surge Deployment

Add Deployment Success Comment function

* Revert "ci: Add Manual Trigger Action"

This reverts commit 5bd75d1e58.

* Revert "ci: add doc-site workflow"

This reverts commit ec7e7e40e7.

* ci: update ci config
This commit is contained in:
Wuxh 2022-12-07 17:44:00 +08:00 committed by GitHub
parent cccbab7c6d
commit a8a9607bd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,8 @@
name: Deploy website name: Deploy website
on: on:
create release:
types: [published]
permissions: permissions:
contents: write contents: write
@ -10,7 +11,7 @@ permissions:
jobs: jobs:
setup: setup:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event.ref_type == 'tag' && (contains(github.event.ref, '-') == false) if: startsWith(github.ref, 'refs/tags/') && (contains(github.ref_name, '-') == false)
steps: steps:
- name: checkout - name: checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
@ -63,9 +64,24 @@ jobs:
- name: build - name: build
run: npm run predeploy run: npm run predeploy
- name: deploy - 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@v3 uses: peaceiris/actions-gh-pages@v3
with: with:
github_token: ${{ secrets.GITHUB_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_site publish_dir: ./_site
force_orphan: true force_orphan: true
- name: Deploy to Surge (with TAG)
run: |
export DEPLOY_DOMAIN=ant-design-${{ steps.publish-version.outputs.VERSION }}.surge.sh
npx surge --project ./_site --domain $DEPLOY_DOMAIN --token ${{ secrets.SURGE_TOKEN }}
- name: Create Commit Comment
uses: peter-evans/commit-comment@v1
with:
body: |
Doc site for this release: https://ant-design-${{ steps.publish-version.outputs.VERSION }}.surge.sh