Skip to content

Merge branch 'main' of https://github.com/jwbth/convenient-discussions #297

Merge branch 'main' of https://github.com/jwbth/convenient-discussions

Merge branch 'main' of https://github.com/jwbth/convenient-discussions #297

Workflow file for this run

name: Deploy i18n
on:
push:
branches:
- main
paths:
- 'i18n/*'
- '!i18n/qqq.json'
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci
- run: node buildI18n
- name: Create a SSH tunnel and deploy
env:
SSH_USER: ${{ secrets.TOOLFORGE_USER }}
SSH_KEY: ${{ secrets.TOOLFORGE_KEY }}
USERNAME: ${{ secrets.WIKI_USERNAME }}
PASSWORD: ${{ secrets.WIKI_PASSWORD }}
run: |
mkdir -p ~/.ssh
echo -e "$SSH_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
# Create a SSH tunnel in the background.
ssh -o StrictHostKeyChecking=no -N -D 1081 ${{ secrets.TOOLFORGE_USER }}@tools-login.wmflabs.org &
SSH_JOB="$!"
# This trap will get overrided below, but also set it here just in case HPTS fails to
# start.
trap "kill $SSH_JOB" EXIT
# Run the converter of a HTTP proxy to SOCKS.
./node_modules/.bin/hpts -s 127.0.0.1:1081 -p 8080 &
HPTS_JOB="$!"
# Kill both background jobs on exit.
trap "kill $SSH_JOB; kill $HPTS_JOB" EXIT
sleep 3
rm ~/.ssh/id_rsa
# Run own script to login and publish the build results to pages.
npm run deploy --i18nonly