add cicd_script
Some checks failed
Hexo Blog CICD / Deploy blog (push) Has been cancelled

This commit is contained in:
yunpeng.zhang 2024-12-19 16:11:12 +08:00
parent ce783e6706
commit c141e71d5f
2 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,35 @@
name: Hexo Blog CICD
run-name: ${{ gitea.actor }} hexo blog dev-ops 🚀
on:
push:
branches:
- main
env:
DEPLOYED_DIR: /opt/1panel/apps/openresty/openresty/www/sites/hexoblog/index
jobs:
Deploy-Hexo_Blog:
name: Deploy blog
runs-on: ubuntu-latest
steps:
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Build
run: |
npm install
npm run clean
npm run build
- name: Deploy
run: |
echo "🔄 Deploying Hexo Blog..."
cp -r public/* ${{ env.DEPLOYED_DIR }}
- run: echo "🍏 This job's status is ${{ job.status }}."

View File

@ -647,7 +647,7 @@ aside:
link: https://github.com/AnswerCoder
card_announcement:
enable: true
content: 外面的声音太嘈杂,听自己的心就好
content: ~~~
card_recent_post:
enable: true
limit: 5 # if set 0 will show all