diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1f9f546..cd9618b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -38,9 +38,9 @@ deploy_staging: # - ssh-add ${SSH_DEPLOY_KEY} # - mkdir -p ~/.ssh # - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' - - script: + before_script: - bash ${CI_PROJECT_DIR}/.more-ci/deploy-pre.sh ${SSH_DEPLOY_KEY} + script: # - "cat ${ENV_FILE} | ssh rockfic@${DEPLOY_SERVER} 'cat > ~/rockfic-staging/.env'" - rsync --archive --del ${CI_PROJECT_DIR}/ rockfic@${DEPLOY_SERVER}:~/rockfic-staging/ - scp ${ENV_FILE} rockfic@${DEPLOY_SERVER}:rockfic-staging/.env @@ -59,13 +59,14 @@ deploy_production: name: production url: https://www.rockfic.com image: ubuntu:latest - script: + before_script: - bash ${CI_PROJECT_DIR}/.more-ci/deploy-pre.sh ${SSH_DEPLOY_KEY} + script: - rsync --archive --del ${CI_PROJECT_DIR}/ root@${DEPLOY_SERVER}:/home/@rockfic/ - scp ${ENV_FILE} root@${DEPLOY_SERVER}:/home/@rockfic/.env #- rsync --archive --delete ${CI_PROJECT_DIR}/cnf/ ${DEPLOY_USER}@${DEPLOY_SERVER}:~/cnf/ - ssh root@${DEPLOY_SERVER} node "/home/@rockfic/.output/server/index.mjs" \&\>/dev/null \& disown \%1 - - ssh rockfic@${DEPLOY_SERVER} sudo systemctl reload apache2 + - ssh root@${DEPLOY_SERVER} sudo systemctl reload apache2 only: - tags # restrict to specific branch