Skip to content

Commit

Permalink
ci/cd: fix scp/ssh steps by switching to appleboy actions
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharthvp committed May 26, 2024
1 parent b8df6da commit cf8a2a1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 10 additions & 11 deletions .github/workflows/ci-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ on:
- 'package-lock.json'
- '.github/workflows/ci-push.yml'
schedule:
- cron: '0 12 * * 0'
- cron: '30 12 * * 0'
workflow_dispatch:

jobs:
build:
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
Expand Down Expand Up @@ -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 }}
15 changes: 7 additions & 8 deletions .github/workflows/docs-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,22 @@ 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)
unzip /data/project/mwn/docs.zip -d .
rm /data/project/mwn/docs.zip
host: login.toolforge.org
username: ${{secrets.TOOLFORGE_USERNAME}}
privateKey: ${{secrets.TOOLFORGE_PRIVATE_KEY}}
key: ${{secrets.TOOLFORGE_PRIVATE_KEY}}
2 changes: 1 addition & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cf8a2a1

Please sign in to comment.