39 lines
1.2 KiB
YAML
39 lines
1.2 KiB
YAML
name: Hexo Blog CICD
|
|
run-name: ${{ gitea.actor }} hexo blog dev-ops 🚀
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
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: Configure Node
|
|
run: npm config set registry https://registry.npmmirror.com
|
|
|
|
- name: Check out repository code
|
|
uses: actions/checkout@v4
|
|
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
|
|
|
|
- name: Build
|
|
run: |
|
|
npm install
|
|
npm run clean
|
|
npm run build
|
|
- name: Deploy to Home Server
|
|
uses: easingthemes/ssh-deploy@main
|
|
with:
|
|
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
ARGS: "-rlgoDzvc -i --delete"
|
|
SOURCE: "public/"
|
|
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
|
|
REMOTE_USER: ${{ secrets.REMOTE_USER }}
|
|
TARGET: ${{ secrets.REMOTE_TARGET }}
|
|
EXCLUDE: "/public/, /node_modules/"
|
|
- name: Deploy to GitHub Pages
|
|
run: npm run deploy
|
|
- run: echo "🍏 This job's status is ${{ job.status }}." |