diff options
| author | yingyu5658 <i@yingyu5658.me> | 2025-12-13 09:10:32 +0800 |
|---|---|---|
| committer | yingyu5658 <i@yingyu5658.me> | 2025-12-13 09:10:32 +0800 |
| commit | ba31507a1c78adeeaf4f27a5047a95b43946b859 (patch) | |
| tree | cd34e94856df9d2f6a553a272ad2552094f35a02 /publish.sh | |
| parent | 7486f7af0084f03aeb5ae3e32457e1245741fc0b (diff) | |
| download | blog-ba31507a1c78adeeaf4f27a5047a95b43946b859.tar.gz blog-ba31507a1c78adeeaf4f27a5047a95b43946b859.zip | |
feat: add emacs publish workflow
Diffstat (limited to 'publish.sh')
| -rw-r--r-- | publish.sh | 38 |
1 files changed, 2 insertions, 36 deletions
@@ -7,42 +7,8 @@ commit_date=$(date +"%Y-%m-%d %H:%M:%S") -if [ "$1" = "-b" ] || [ "$1" = "--blog" ]; then - cd ~/blog || exit 1 - hugo - git add . - git commit -m "自动提交:$commit_date" - echo "pushing hugo-blog-backup" - git push origin main - cd ~/blog/public || exit 1 - html-minifier index.html --output index.html --collapse-whitespace --remove-comments + hugo --cleanDestinationDir --gc git add . - git commit -m "自动提交:$commit_date" - echo "pushing yingyu5658.github.io" + git commit -m "auto update: $commit_date" git push origin main - -elif [ "$1" = "-n" ] || [ "$1" = "--newsgroup" ]; then - echo "git clone https://gitee.com/yingyu5658/newsgroup_archives.git" - cd ~/blog || exit 1 - rm -rf newsgroup_archives # Cleanup any existing clone - git clone https://gitee.com/yingyu5658/newsgroup_archives.git - mv newsgroup_archives/index.html ~/newsgroup_archives/index.html - rm -rf newsgroup_archives - - cd ~/newsgroup_archives/ || exit 1 - git add . - git commit -m "$commit_date" - echo "pushing newsgroup_archives" - git pull origin main # Pull latest changes before pushing - git push origin main - -else - echo "No argument!" - exit 1 -fi - - -cd ~/blog || exit 1 -echo "=========" -echo "操作完成!" |
