From cf8a2a1cfbad7448c896675cd820252b0a09a29f Mon Sep 17 00:00:00 2001 From: Siddharth VP Date: Mon, 27 May 2024 02:40:51 +0530 Subject: [PATCH] ci/cd: fix scp/ssh steps by switching to appleboy actions --- .github/workflows/ci-pull-request.yml | 4 ++-- .github/workflows/ci-push.yml | 21 ++++++++++----------- .github/workflows/docs-deploy.yml | 15 +++++++-------- .github/workflows/npm-publish.yml | 2 +- 4 files changed, 20 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci-pull-request.yml b/.github/workflows/ci-pull-request.yml index 57e3597..18bffbf 100644 --- a/.github/workflows/ci-pull-request.yml +++ b/.github/workflows/ci-pull-request.yml @@ -15,10 +15,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Use Node.js 16.x + - name: Use Node.js 20.x uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 20 - run: npm ci - run: npm run lint - run: npm run build diff --git a/.github/workflows/ci-push.yml b/.github/workflows/ci-push.yml index 2854040..ae496b8 100644 --- a/.github/workflows/ci-push.yml +++ b/.github/workflows/ci-push.yml @@ -12,7 +12,7 @@ on: - 'package-lock.json' - '.github/workflows/ci-push.yml' schedule: - - cron: '0 12 * * 0' + - cron: '30 12 * * 0' workflow_dispatch: jobs: @@ -20,10 +20,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Use Node.js 16.x + - name: Use Node.js 20.x uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 20 - run: npm ci - run: npm run lint - run: npm run build @@ -88,21 +88,20 @@ jobs: mv coverage/lcov-report/* coverage zip -r coverage.zip coverage - name: Upload coverage reports to Toolforge - uses: garygrossgarten/github-action-scp@8a27854bb4f124a497a67316e83783efda770119 + uses: appleboy/scp-action@9ba62064d28ce0897a970e72cdfe30b9fde2fe48 with: - local: /home/runner/work/mwn/mwn/coverage.zip - remote: /data/project/mwn/coverage.zip + source: /home/runner/work/mwn/mwn/coverage.zip + target: /data/project/mwn host: login.toolforge.org username: ${{ secrets.TOOLFORGE_USERNAME }} - privateKey: ${{ secrets.TOOLFORGE_PRIVATE_KEY }} - rmRemote: true + key: ${{ secrets.TOOLFORGE_PRIVATE_KEY }} - name: Coverage - uses: garygrossgarten/github-action-ssh@915e492551885a89131e21d85f2e043c96abff80 + uses: appleboy/ssh-action@551964ebda1034f0b5449d74db25c42e371ca1f7 with: - command: | + script: | cd /data/project/mwn rm -rf www/static/coverage unzip coverage.zip -d www/static host: login.toolforge.org username: ${{ secrets.TOOLFORGE_USERNAME }} - privateKey: ${{ secrets.TOOLFORGE_PRIVATE_KEY }} + key: ${{ secrets.TOOLFORGE_PRIVATE_KEY }} diff --git a/.github/workflows/docs-deploy.yml b/.github/workflows/docs-deploy.yml index 61083e6..12fc900 100644 --- a/.github/workflows/docs-deploy.yml +++ b/.github/workflows/docs-deploy.yml @@ -30,18 +30,17 @@ jobs: cd website/build zip -r docs.zip . - name: Copy docs to Toolforge - uses: garygrossgarten/github-action-scp@8a27854bb4f124a497a67316e83783efda770119 + uses: appleboy/scp-action@9ba62064d28ce0897a970e72cdfe30b9fde2fe48 with: - local: ${{github.workspace}}/website/build/docs.zip - remote: /data/project/mwn/docs.zip + source: ${{github.workspace}}/website/build/docs.zip + target: /data/project/mwn host: login.toolforge.org username: ${{secrets.TOOLFORGE_USERNAME}} - privateKey: ${{secrets.TOOLFORGE_PRIVATE_KEY}} - rmRemote: true + key: ${{secrets.TOOLFORGE_PRIVATE_KEY}} - name: Unzip - uses: garygrossgarten/github-action-ssh@915e492551885a89131e21d85f2e043c96abff80 + uses: appleboy/ssh-action@551964ebda1034f0b5449d74db25c42e371ca1f7 with: - command: | + script: | cd /data/project/mwn/www/static shopt -s extglob rm -r -- !(coverage) @@ -49,4 +48,4 @@ jobs: rm /data/project/mwn/docs.zip host: login.toolforge.org username: ${{secrets.TOOLFORGE_USERNAME}} - privateKey: ${{secrets.TOOLFORGE_PRIVATE_KEY}} + key: ${{secrets.TOOLFORGE_PRIVATE_KEY}} diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 099bf55..24d0842 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 20 registry-url: https://registry.npmjs.org/ - run: npm ci - run: npm run build