Skip to content

Commit

Permalink
✨ update version v1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas-kings committed Mar 15, 2024
1 parent 2194cb9 commit 044a4f9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
FROM node:18.15.0-buster-slim

LABEL version="1.0.0"
LABEL version="1.0.1"
LABEL repository="https://github.com/Nicolasking007/hexo-action-pro"
LABEL homepage="https://Nicolasking007.github.io"
LABEL maintainer="Nicolasking007 <[email protected]>"

COPY entrypoint.sh /entrypoint.sh
LABEL "com.github.actions.name"="Hexo Action pro"
LABEL "com.github.actions.description"="Hexo CI/CD action for automating deployment."
LABEL "com.github.actions.icon"="upload-cloud"
LABEL "com.github.actions.color"="green"

COPY README.md LICENSE entrypoint.sh /
COPY sync_deploy_history.js /sync_deploy_history.js

RUN apt-get update > /dev/null && \
Expand Down
14 changes: 8 additions & 6 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,27 @@ git config --global user.name "$INPUT_USER_NAME"
git config --global user.email "$INPUT_USER_EMAIL"

# 安装 Hexo 环境
echo ">_ Install NPM dependencies ..."
npm install

echo ">_ Clean cache files ..."
npx hexo clean

echo ">_ Generate file ..."
npx hexo generate

# 部署
if [ "$INPUT_COMMIT_MSG" = "none" ]; then
# 避免 hexo-butterfly-douban 构建冲突,使用 hexo g -deploy
hexo clean
hexo g
hexo deploy
elif [ "$INPUT_COMMIT_MSG" = "" ] || [ "$INPUT_COMMIT_MSG" = "default" ]; then
# 拉取原始发布仓库
NODE_PATH=$NODE_PATH:$(pwd)/node_modules node /sync_deploy_history.js
hexo clean
hexo g
hexo deploy
else
# 指定提交消息
NODE_PATH=$NODE_PATH:$(pwd)/node_modules node /sync_deploy_history.js
hexo clean
hexo g -deploy -m "$INPUT_COMMIT_MSG"
hexo deploy -m "$INPUT_COMMIT_MSG"
fi

echo ::set-output name=notify::"部署完成。"

0 comments on commit 044a4f9

Please sign in to comment.