Skip to content

Commit

Permalink
ci add artifacts build/upload for cloudflare
Browse files Browse the repository at this point in the history
  • Loading branch information
Paper-Dragon committed Nov 27, 2023
1 parent a6e146f commit 60d677c
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 2 deletions.
48 changes: 47 additions & 1 deletion .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions:
contents: write

jobs:
deploy-gh-pages:
pre-build:
runs-on: ubuntu-latest
steps:
- name: 拉源码
Expand Down Expand Up @@ -44,7 +44,20 @@ jobs:
node-version: 18
cache: pnpm

cloudflare-geekery_cn-pre-build:
runs-on: ubuntu-latest
needs: pre-build
steps:
- name: modify
run: |-
sed -i "s/hostname: "https:\/\/paper-dragon.github.io",/hostname: "https:\/\/www.geekery.cn",/g" src/.vuepress/theme.ts
grep hostname src/.vuepress/theme.ts
build-github-pages:
runs-on: ubuntu-latest
needs: pre-build
steps:
- name: 构建文档
env:
NODE_OPTIONS: --max_old_space_size=8192
Expand All @@ -60,13 +73,45 @@ jobs:
# 产物保留时间
retention-days: 3

build-geekery_cn-pages:
runs-on: ubuntu-latest
needs: build-github-pages
steps:
- name: 构建文档
env:
NODE_OPTIONS: --max_old_space_size=8192
run: |-
pnpm run docs:build
> src/.vuepress/dist/.nojekyll
- name: 上传构建产物
uses: actions/[email protected]
with:
name: geekery_cn-artifacts-html
path: src/.vuepress/dist/
# 产物保留时间
retention-days: 3

deploy-github-page:
runs-on: ubuntu-latest
steps:
- name: 部署文档
uses: JamesIves/github-pages-deploy-action@v4
with:
# 这是文档部署到的分支名称
branch: gh-pages
folder: src/.vuepress/dist

deploy-cloudflare-geekery_cn-page:
runs-on: ubuntu-latest
steps:
- name: 部署文档
uses: JamesIves/github-pages-deploy-action@v4
with:
# 这是文档部署到的分支名称
branch: geekery_cn-pages
folder: src/.vuepress/dist

publish-docker:
runs-on: ubuntu-latest
needs: deploy-gh-pages
Expand Down Expand Up @@ -99,6 +144,7 @@ jobs:
file: ./Dockerfile
push: true
tags: ${{ vars.DOCKERHUB_USERNAME }}/notebook:${{ env.TAGDATE }}

deploy-hosted:
runs-on: self-hosted
needs: deploy-gh-pages
Expand Down
2 changes: 1 addition & 1 deletion src/.vuepress/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import navbar from "./navbar.js";
import sidebar from "./sidebar.js";

export default hopeTheme({
hostname: "paper-dragon.github.io",
hostname: "https://paper-dragon.github.io",

fullscreen: true,

Expand Down

0 comments on commit 60d677c

Please sign in to comment.