From aabe08270f27179e657c1a684aa4142466a2e9e8 Mon Sep 17 00:00:00 2001 From: bendn Date: Wed, 21 Feb 2024 07:49:40 +0700 Subject: [PATCH] fix ci --- .github/workflows/ci-cd.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index 805ad0c..0ff97e3 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -8,11 +8,16 @@ jobs: build: runs-on: ubuntu-latest steps: + - name: write secret + shell: python + run: | + with open("pass", "w") as f: f.write("${{ secrets.SSH_PASS }}") + - name: Run SSHPASS run: | sshpass \ - -p ${{ secrets.SSH_PASS }} \ + -f pass \ ssh \ -o 'StrictHostKeyChecking no' \ - -p ${{ secrets.SSH_PORT }} ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} \ - 'cd /root/selendra-explorer-nextjs && git checkout main && git pull && npm i --force && npm run build && pm2 restart 4' + -p ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} \ + 'cd /root/selendra-explorer-nextjs && git checkout main && git checkout . && git pull --rebase && npm i --force && npm run build && pm2 restart 4'