Skip to content

docs: 更新文档 #243

docs: 更新文档

docs: 更新文档 #243

Workflow file for this run

name: 部署文档
on:
push:
tags:
- 'doc*'
jobs:
deploy-pages:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: 展示版本
run: echo ${{ steps.get_version.outputs.VERSION }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: 安装 pnpm
uses: pnpm/action-setup@v2
with:
run_install: true
- name: 设置 Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: 构建文档
id: image-name
env:
NODE_OPTIONS: --max_old_space_size=4096
run: |-
pnpm docs:build
> docs/.vuepress/dist/.nojekyll
- name: 打包镜像并推送
uses: docker/build-push-action@v2
with:
context: ./docs
file: ./docs/Dockerfile
platforms: linux/amd64
push: true
tags: |
"docker.io/mereith/van-blog-website:${{ steps.get_version.outputs.VERSION }}"
- name: 部署到集群
uses: steebchen/[email protected]
with: # defaults to latest kubectl binary version
config: ${{ secrets.K8S_CONFIG_DATA }}
command: set image deployment/vanblog-doc vanblog-doc=docker.io/mereith/van-blog-website:${{ steps.get_version.outputs.VERSION }}
- name: 等待部署生效
run: sleep 300
- name: 刷新 CDN 缓存
run: |-
curl -X POST -H "Content-Type: application/json" --header 'token: ${{ secrets.CDN_REFLASH_SECRET }}' -d '{"url":"https://vanblog.mereith.com/"}' ${{ secrets.CDN_REFLASH_URL }}