ci: sync git repository on VPS during deployment
This commit is contained in:
1 parent
5cd9ea92a7
commit
96b8765966
1 file changed
+4
-2
@@ -171,11 +171,12 @@ jobs:
|
|||||||
"sudo /nix/var/nix/profiles/default/bin/nix-store --realise '$STORE_PATH' 2>&1 || true")
|
"sudo /nix/var/nix/profiles/default/bin/nix-store --realise '$STORE_PATH' 2>&1 || true")
|
||||||
echo "$REALISE_RESULT"
|
echo "$REALISE_RESULT"
|
||||||
|
|
||||||
# Update profile + restart
|
# Update profile + sync git repo + restart
|
||||||
ssh "$VPS_USER@$VPS_HOST" \
|
ssh "$VPS_USER@$VPS_HOST" \
|
||||||
"sudo /nix/var/nix/profiles/default/bin/nix-env \
|
"sudo /nix/var/nix/profiles/default/bin/nix-env \
|
||||||
--profile /nix/var/nix/profiles/$PROFILE \
|
--profile /nix/var/nix/profiles/$PROFILE \
|
||||||
--set '$STORE_PATH' && \
|
--set '$STORE_PATH' && \
|
||||||
|
(cd /home/code/mcpedia && git fetch origin main && git reset --hard origin/main || true) && \
|
||||||
sudo systemctl restart $PROFILE && \
|
sudo systemctl restart $PROFILE && \
|
||||||
sleep 3 && \
|
sleep 3 && \
|
||||||
sudo systemctl status $PROFILE --no-pager --no-legend | head -5"
|
sudo systemctl status $PROFILE --no-pager --no-legend | head -5"
|
||||||
@@ -306,11 +307,12 @@ jobs:
|
|||||||
# Substitute from Attic cache (fast)
|
# Substitute from Attic cache (fast)
|
||||||
ssh "$VPS_USER@$VPS_HOST" \
|
ssh "$VPS_USER@$VPS_HOST" \
|
||||||
"sudo /nix/var/nix/profiles/default/bin/nix-store --realise '$STORE_PATH'"
|
"sudo /nix/var/nix/profiles/default/bin/nix-store --realise '$STORE_PATH'"
|
||||||
# Update profile + restart
|
# Update profile + sync git repo + restart
|
||||||
ssh "$VPS_USER@$VPS_HOST" \
|
ssh "$VPS_USER@$VPS_HOST" \
|
||||||
"sudo /nix/var/nix/profiles/default/bin/nix-env \
|
"sudo /nix/var/nix/profiles/default/bin/nix-env \
|
||||||
--profile /nix/var/nix/profiles/mcpedia-web \
|
--profile /nix/var/nix/profiles/mcpedia-web \
|
||||||
--set '$STORE_PATH' && \
|
--set '$STORE_PATH' && \
|
||||||
|
(cd /home/code/mcpedia && git fetch origin main && git reset --hard origin/main) && \
|
||||||
sudo systemctl restart mcpedia-web && \
|
sudo systemctl restart mcpedia-web && \
|
||||||
sleep 3 && \
|
sleep 3 && \
|
||||||
sudo systemctl status mcpedia-web --no-pager --no-legend | head -5"
|
sudo systemctl status mcpedia-web --no-pager --no-legend | head -5"
|
||||||
|
|||||||
Reference in new issue
Block a user