-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:Paper-Dragon/paper-dragon.github.io
- Loading branch information
Showing
1 changed file
with
44 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
name: 部署文档 | ||
name: 部署文档和发布镜像 | ||
|
||
on: | ||
push: | ||
|
@@ -14,10 +14,10 @@ jobs: | |
deploy-gh-pages: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
- name: 拉源码 | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
fetch-depth: 1 | ||
# 如果你文档需要 Git 子模块,取消注释下一行 | ||
# submodules: true | ||
|
||
|
@@ -42,9 +42,50 @@ jobs: | |
pnpm run docs:build | ||
> src/.vuepress/dist/.nojekyll | ||
- name: 上传构建产物 | ||
uses: actions/[email protected] | ||
with: | ||
name: artifacts-html | ||
path: src/.vuepress/dist/ | ||
# 产物保留时间 | ||
retention-days: 3 | ||
|
||
- name: 部署文档 | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
# 这是文档部署到的分支名称 | ||
branch: gh-pages | ||
folder: src/.vuepress/dist | ||
|
||
publish-docker: | ||
runs-on: ubuntu-latest | ||
needs: deploy-gh-pages | ||
steps: | ||
- name: 拉源码 | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: 把当前时间放到环境变量里 | ||
run: echo "TAGDATE=$(date +'%Y-%m-%d-%H-%M')" >> $GITHUB_ENV | ||
|
||
|
||
- name: 下载上一个步骤生成的产物 | ||
uses: actions/[email protected] | ||
with: | ||
name: artifacts-html | ||
path: ./file | ||
|
||
- name: 登陆到DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ vars.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: 构建和推送docker镜像 | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
tags: ${{ vars.DOCKERHUB_USERNAME }}/notebook:${{ env.TAGDATE }} |