docs(:sparkles:): release 4.24.16 (#47932) #2272
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
# When publish a release. This workflow will trigger and deploy to site. | |
name: Deploy website | |
on: | |
push: | |
tags: | |
- '4.*' | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
setup: | |
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 | |
- name: cache package-lock.json | |
uses: actions/cache@v3 | |
with: | |
path: package-temp-dir | |
key: lock-${{ github.sha }} | |
- name: create package-lock.json | |
run: npm i --package-lock-only --ignore-scripts | |
- name: hack for single file | |
run: | | |
if [ ! -d "package-temp-dir" ]; then | |
mkdir package-temp-dir | |
fi | |
cp package-lock.json package-temp-dir | |
- name: cache node_modules | |
id: node_modules_cache_id | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} | |
- name: install | |
if: steps.node_modules_cache_id.outputs.cache-hit != 'true' | |
run: npm ci | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
needs: setup | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: restore cache from package-lock.json | |
uses: actions/cache@v3 | |
with: | |
path: package-temp-dir | |
key: lock-${{ github.sha }} | |
- name: restore cache from node_modules | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} | |
- name: build | |
run: npm run predeploy | |
- name: deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
deploy_key: ${{ secrets.SITE_4X_DEPLOY_KEY }} | |
external_repository: ant-design/4x.ant.design | |
publish_dir: ./_site |