autodeploy #68
Workflow file for this run
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 | |
on: | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: master | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v2 | |
- name: Use Node 16.x | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '16.x' | |
- name: List files in the repository | |
run: | | |
ls ${{ github.workspace }} | |
- name: Install and deploy | |
run: | | |
npm install | |
npm run build | |
sudo supervisorctl stop api | |
rm -rf /var/www/plezanjenet/api/* | |
cp -r ./ /var/www/plezanjenet/api/ | |
cp /var/www/plezanjenet/.env /var/www/plezanjenet/api/.env | |
- name: Run database migrations | |
run: | | |
cd /var/www/plezanjenet/api && npm run migration:run | |
- name: Start server | |
run: | | |
sudo supervisorctl start api |