Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Paper-Dragon/paper-dragon.github.io
Browse files Browse the repository at this point in the history
  • Loading branch information
Paper-Dragon committed Aug 15, 2023
2 parents ff0d618 + 02b34ab commit 38f3066
Showing 1 changed file with 44 additions and 3 deletions.
47 changes: 44 additions & 3 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

name: 部署文档
name: 部署文档和发布镜像

on:
push:
Expand All @@ -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

Expand All @@ -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 }}

0 comments on commit 38f3066

Please sign in to comment.