ci: added basic workflow of automated build and deploy
This commit is contained in:
35
.gitea/workflows/ready.yml
Normal file
35
.gitea/workflows/ready.yml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
name: Build and Deploy to CDN
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
run: |
|
||||||
|
git clone "$GITEA_REPO_URL" repo
|
||||||
|
cd repo
|
||||||
|
git checkout $GITEA_COMMIT_SHA
|
||||||
|
env:
|
||||||
|
GITEA_REPO_URL: ${{ gitea.repository.url }}
|
||||||
|
GITEA_COMMIT_SHA: ${{ gitea.sha }}
|
||||||
|
|
||||||
|
- name: Install Node.js
|
||||||
|
run: |
|
||||||
|
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
|
||||||
|
sudo apt-get install -y nodejs
|
||||||
|
|
||||||
|
- name: Verify Node and npm
|
||||||
|
run: node --version && npm --version
|
||||||
|
|
||||||
|
- name: Install dependencies and build
|
||||||
|
run: |
|
||||||
|
cd repo
|
||||||
|
npm ci
|
||||||
|
npm run build
|
||||||
|
npm test
|
||||||
|
|
||||||
|
- name: Deploy via rsync
|
||||||
|
run: rsync -avz --delete repo/dist ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}:${{ secrets.DEPLOY_PATH }}/
|
||||||
Reference in New Issue
Block a user