From de52687a28483477d22208c8dd723c585af3e413 Mon Sep 17 00:00:00 2001 From: Anatoly Kopyl Date: Tue, 11 Feb 2025 12:50:49 +0300 Subject: [PATCH] Add ci --- .gitea/workflows/ci.yaml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .gitea/workflows/ci.yaml diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml new file mode 100644 index 0000000..bf438a1 --- /dev/null +++ b/.gitea/workflows/ci.yaml @@ -0,0 +1,34 @@ +name: Deploy +on: + push: + branches: + - master + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v4 + + - name: Install dependencies + run: npm install + + - name: Build project + run: npm run build + + - name: Set up SSH + uses: webfactory/ssh-agent@v0.5.3 + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + + - name: Deploy to Server + env: + SSH_USER: ${{ secrets.DEPLOY_USER }} + SSH_HOST: ${{ secrets.DEPLOY_HOST }} + SSH_PORT: ${{ secrets.DEPLOY_PORT }} + DEPLOY_PATH: ${{ secrets.DEPLOY_PATH }} + run: | + echo "Deploying to ${SSH_USER}@${SSH_HOST}:${DEPLOY_PATH}" + ssh -o StrictHostKeyChecking=no -p ${SSH_PORT} ${SSH_USER}@${SSH_HOST} "mkdir -p ${DEPLOY_PATH}" + scp -o StrictHostKeyChecking=no -P ${SSH_PORT} -r dist/* ${SSH_USER}@${SSH_HOST}:${DEPLOY_PATH}