fix: get server data from sdo website #207
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
name: Updates | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 签出仓库 | |
uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- name: 安装 Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18.x" | |
cache: 'yarn' | |
- name: 缓存 VuePress | |
uses: actions/cache@v3 | |
with: | |
path: ~/vuepresscache | |
key: vuepress-${{ hashFiles('yarn.lock') }} | |
- name: 安装依赖 | |
run: yarn --frozen-lockfile | |
- name: 构建网站 | |
run: yarn vuepress build docs --cache $HOME/vuepresscache && rm -rf dist/_includes | |
env: | |
NODE_OPTIONS: '--openssl-legacy-provider' | |
- name: 导出部署密钥 | |
run: echo "$DEPLOY_KEY" > ci/deploy-key | |
env: | |
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} | |
- name: 运行部署脚本 | |
run: | | |
chmod +x ./ci/deploy.sh | |
./ci/deploy.sh | |
env: | |
UPDATE_KEY: ${{ secrets.UPDATE_KEY }} | |
- name: 触发网站更新 | |
run: curl -XPOST $GITPAGES_UPDATE_URL | |
env: | |
GITPAGES_UPDATE_URL: ${{ secrets.GITPAGES_UPDATE_URL }} |