merge resolved #34
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 to Server | |
on: | |
push: | |
branches: | |
- master # Set this to the branch you want to deploy from | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "16" | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install Node.js version 18 using NVM | |
run: | | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" | |
nvm install 18 | |
nvm use 18 | |
node -v | |
- name: Deploy to Server | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.DEPLOY_KEY }} | |
script: | | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" | |
nvm use 18 | |
cd /var/www/no-game.xyz/nogame-app | |
git pull origin master | |
# Add commands to build and restart your applications | |
npm install | |
cd packages/backend | |
echo '${{ secrets.BACKEND_ENV_FILE }}' > .env | |
npm install | |
npm run build | |
cd ../frontend | |
echo '${{ secrets.FRONTEND_ENV_FILE }}' > .env | |
npm install | |
npm run build | |
pm2 restart all |