From b148e20b2f44f96180845af7d157390768cc0529 Mon Sep 17 00:00:00 2001 From: Alexander Alemayhu Date: Sun, 22 Oct 2023 11:55:46 +0200 Subject: [PATCH] build: use temporary build path Closes: https://github.com/2anki/2anki.net/issues/1276 --- .github/workflows/deploy.2anki.net.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.2anki.net.yml b/.github/workflows/deploy.2anki.net.yml index ce3c1c7b2..31b5fe8af 100644 --- a/.github/workflows/deploy.2anki.net.yml +++ b/.github/workflows/deploy.2anki.net.yml @@ -22,6 +22,7 @@ jobs: 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 @@ -37,7 +38,8 @@ jobs: pip install -r ${CREATE_DECK_DIR}/requirements.txt npm --prefix ${SERVER_DIR} run build - npm --prefix ${WEB_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