Add Celt Rites Buff #209
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: Build and Deploy to production | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@master | |
- name: Use Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 14.17.6 | |
- run: npm install --production | |
- run: npm run build-prod | |
- run: mv dist server/front | |
- run: cd server && npm install --production && cd .. | |
- name: Upload artifact | |
uses: actions/upload-artifact@v1 | |
with: | |
name: dist | |
path: server/ | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v1 | |
with: | |
name: dist | |
- name: Delete old files | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
password: ${{ secrets.PASSWORD }} | |
port: ${{ secrets.PORT }} | |
script: | | |
shopt -s extglob | |
sudo systemctl stop ${{ secrets.SERVICE_NAME_PROD }} | |
cd ${{ secrets.DEPLOY_TARGET }} | |
rm -rf !(build-db.sqlite) | |
- name: Upload files | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
password: ${{ secrets.PASSWORD }} | |
port: ${{ secrets.PORT }} | |
strip_components: 1 | |
source: "dist" | |
target: "${{ secrets.DEPLOY_TARGET }}" | |
restart: | |
runs-on: ubuntu-latest | |
needs: deploy | |
steps: | |
- name: Restart service | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
password: ${{ secrets.PASSWORD }} | |
port: ${{ secrets.PORT }} | |
script: | | |
sudo systemctl start ${{ secrets.SERVICE_NAME_PROD }} |