36 lines
1.0 KiB
YAML
36 lines
1.0 KiB
YAML
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: Configure
|
|
run: |
|
|
npm config set registry https://registry.npmmirror.com
|
|
npx --yes actions/setup-node@v3 --node-version 16.18
|
|
|
|
- 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 }}." |