updated for script #11
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: "18" | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Deploy to Server | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.DEPLOY_KEY }} | |
script: | | |
cd /var/www/no-game.xyz/nogame-app | |
git pull origin master | |
node -v | |
# Add commands to build and restart your applications | |
npm install | |
cd packages/backend | |
echo '${{ secrets.BACKEND_ENV_FILE }}' > .env | |
npm install | |
npm run build | |
pm2 restart all | |
cd ../frontend | |
echo '${{ secrets.FRONTEND_ENV_FILE }}' > .env | |
npm install | |
npm run build |