feat/Minor Adjust #28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Prod | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up SSH | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_KEY }} | |
- name: Deploy to VPS | |
run: | | |
ssh -o StrictHostKeyChecking=no ${{ secrets.USERNAME }}@${{ secrets.HOST }} <<EOF | |
cd ~/tibia/web | |
source /root/.bashrc | |
source /usr/local/rvm/scripts/rvm | |
source /root/.nvm/nvm.sh | |
nvm install 16 | |
rvm use 3.2.2 | |
nvm use 16 | |
# Remove layout | |
rake assets:clobber | |
rm -rf public/packs/* | |
rm -R node_modules | |
# Update | |
git pull | |
bundle install | |
rails db:migrate RAILS_ENV=production | |
yarn install --check-files | |
# Prepare Front | |
RAILS_ENV=production bundle exec rake assets:precompile | |
# Reinicie o servidor web / aplicação conforme necessário | |
# Exemplo com Passenger: | |
# passenger-config restart-app /path/to/your/app | |
# bin/rails s -p 3030 RAILS_ENV=production | |
sudo systemctl restart tibia_web.service | |
EOF |