Bye gitlab pages, welcome cd/ci with server

This commit is contained in:
Firq 2023-03-06 19:12:59 +01:00
parent acc66bafeb
commit a674b41d00
Signed by: Firq
GPG key ID: 3ACC61C8CEC83C20
13 changed files with 45 additions and 31 deletions

View file

@ -1,14 +1,14 @@
image: node:lts
pages:
cache:
paths:
- node_modules/
deploy-site:
stage: deploy
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
script:
- npm install
- npm run build
artifacts:
paths:
- public
expire_in: 3 days
only:
- main
- echo "Connecting to proxmox machine"
- ssh $DEPLOY_USER@$DEPLOY_HOST "screen -X -S website-firq-npx kill; rm -r -f public/*; cd build; git pull; rm -r -f node_modules; npm install; npm run build; cp -R public ~; cd ~; screen -S website-firq-npx -dm npx serve public/ -p 9000"