From 6b58724fb100de50c6d887d0766f31b7948fc074 Mon Sep 17 00:00:00 2001 From: watson Date: Mon, 21 Oct 2024 17:25:23 +0200 Subject: [PATCH] test new workflow --- .github/workflows/main.yml | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 30948c7..bed4972 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,15 +6,30 @@ on: - master jobs: - build: + Build: runs-on: ubuntu-latest steps: - - name: Set up SSH - run: | + - name: Checkout code + uses: actions/checkout@master + + - name: Set up Node.js + uses: actions/setup-node@master + with: + node-version: '20' + + - name: Install dependencies + run: npm install + + - name: Build + run: npm run build + + - name: Set up SSH + run: | mkdir -p ~/.ssh echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa - - name: Connect to server - run: | - ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }} -p ${{ secrets.SSH_PORT }} "touch octubre/t.txt" + - name: Connect to server + run: | + rsync -avz --delete -e "ssh -i id_rsa -o StrictHostKeyChecking=no -p ${{ secrets.SSH_PORT }}" build/ ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:octubre/ +# ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }} -p ${{ secrets.SSH_PORT }} "cd octubre/ && git stash && git remote set-url origin https://github.com/PPDBTeam6-2023-2024/PPDB-Project.git && git pull origin main --rebase"