Add Gitea deployment workflow
This commit is contained in:
@@ -0,0 +1,39 @@
|
|||||||
|
name: Deploy personal site
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
NODE_HOME: /www/server/nodejs/node-v22.9.0-linux-x64-glibc-217
|
||||||
|
DEPLOY_DIR: /www/wwwroot/flys_blog
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
export PATH="$NODE_HOME/bin:$PATH"
|
||||||
|
node -v
|
||||||
|
npm -v
|
||||||
|
npm ci
|
||||||
|
npm run build
|
||||||
|
test -f out/index.html
|
||||||
|
|
||||||
|
- name: Deploy
|
||||||
|
run: |
|
||||||
|
rm -rf "$DEPLOY_DIR.tmp"
|
||||||
|
mkdir -p "$DEPLOY_DIR.tmp"
|
||||||
|
cp -a out/. "$DEPLOY_DIR.tmp"/
|
||||||
|
chown -R www:www "$DEPLOY_DIR.tmp"
|
||||||
|
|
||||||
|
find "$DEPLOY_DIR" -mindepth 1 -maxdepth 1 -exec rm -rf {} +
|
||||||
|
cp -a "$DEPLOY_DIR.tmp"/. "$DEPLOY_DIR"/
|
||||||
|
chown -R www:www "$DEPLOY_DIR"
|
||||||
|
rm -rf "$DEPLOY_DIR.tmp"
|
||||||
Reference in New Issue
Block a user