Skip to content

fix: preserve the toggle rendering on the back #916

fix: preserve the toggle rendering on the back

fix: preserve the toggle rendering on the back #916

name: Deploy to 2anki.net
on:
push:
paths-ignore:
- '**.md'
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
environment: main
concurrency: 'production'
steps:
- name: SSH and run script
uses: appleboy/[email protected]
with:
host: 2anki.net
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
mkdir -pv /tmp/workspaces
node --version
TMP_BUILD_DIR=`mktemp`
WEB_DIR=~/src/github.com/2anki/web
CREATE_DECK_DIR=~/src/github.com/2anki/create_deck
SERVER_DIR=~/src/github.com/2anki/2anki.net
git -C ${SERVER_DIR} clean -fd
git -C ${WEB_DIR} clean -fd
git -C ${SERVER_DIR} stash
git -C ${WEB_DIR} stash
git -C ${CREATE_DECK_DIR} pull origin
git -C ${SERVER_DIR} pull origin
git -C ${WEB_DIR} pull origin
git -C ${SERVER_DIR} clean -fd
npm --prefix ${WEB_DIR} install
npm --prefix ${SERVER_DIR} install
pip install -r ${CREATE_DECK_DIR}/requirements.txt
rm -r ${TMP_BUILD_DIR}
npm --prefix ${SERVER_DIR} run build
BUILD_PATH=${TMP_BUILD_DIR} npm --prefix ${WEB_DIR} run build
rsync -avh ${TMP_BUILD_DIR} ${WEB_DIR} --delete
cd ${SERVER_DIR}/..
pm2 restart server