Skip to content

ci/cd: fix scp/ssh steps by switching to appleboy actions #123

ci/cd: fix scp/ssh steps by switching to appleboy actions

ci/cd: fix scp/ssh steps by switching to appleboy actions #123

Workflow file for this run

name: Docs deploy
on:
push:
branches: [master]
paths:
- 'src/**'
- 'website/**'
- 'README.md'
- '.github/workflows/docs-deploy.yml'
workflow_dispatch:
jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: |
npm ci
cd website && npm install && cd -
- name: Build documentation
run: cd website && npm run build && cd -
- name: Build API documentation
run: npm run docs:api
- name: Zip docs
run: |
mv docs website/build/docs/api
cd website/build
zip -r docs.zip .
- name: Copy docs to Toolforge
uses: appleboy/scp-action@9ba62064d28ce0897a970e72cdfe30b9fde2fe48
with:
source: ${{github.workspace}}/website/build/docs.zip
target: /data/project/mwn
host: login.toolforge.org
username: ${{secrets.TOOLFORGE_USERNAME}}
key: ${{secrets.TOOLFORGE_PRIVATE_KEY}}
- name: Unzip
uses: appleboy/ssh-action@551964ebda1034f0b5449d74db25c42e371ca1f7
with:
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}}
key: ${{secrets.TOOLFORGE_PRIVATE_KEY}}