From e364884589cb9cb5790423220f84cf59b782b82d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=B5nis=20Saarj=C3=B5e?= Date: Fri, 15 Sep 2023 11:03:19 +0300 Subject: [PATCH] hapl --- .github/workflows/main.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index afcd6f7..eb9cc1f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,9 +5,6 @@ on: branches: - master -env: - SSH_USERNAME: ${{ secrets.SSH_USERNAME }} - jobs: build: runs-on: ubuntu-latest @@ -17,17 +14,19 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v2 with: - node-version: '17' + node-version: '17' # Adjust to the appropriate Node.js version - name: Install dependencies run: npm install --force - - name: install ssh keys - # check this thread to understand why its needed: - # https://stackoverflow.com/a/70447517 + - name: Install SSH keys run: | - install -m 600 -D /dev/null ~/.ssh/id_rsa + mkdir -p ~/.ssh + touch ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa echo "${{ secrets.DEPLOY_RSA }}" > ~/.ssh/id_rsa - ssh-keyscan -H $SSH_HOST > ~/.ssh/known_hosts + ssh-keyscan -H ituk.ee > ~/.ssh/known_hosts - name: Build run: npm run build -prod - name: Deploy - run: rsync -chavzP --rsh="ssh -l $SSH_USERNAME" build/* $SSH_USERNAME@$SSH_HOST:/var/ituk.ee/build \ No newline at end of file + run: rsync -chavzP --rsh="ssh -l deploy" build/* deploy@ituk.ee:/var/ituk.ee/build + - name: Cleanup SSH keys + run: rm ~/.ssh/id_rsa \ No newline at end of file