29 lines
686 B
YAML
29 lines
686 B
YAML
name: 🚀 Deploy
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request: {}
|
|
|
|
jobs:
|
|
deploy:
|
|
name: 🚀 Deploy
|
|
runs-on: self-hosted
|
|
# only build/deploy main branch on pushes
|
|
if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }}
|
|
|
|
steps:
|
|
- name: ⬇️ Checkout repo
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Apply secret env
|
|
run: |
|
|
echo 'DATABASE_URL="file:./prod.db"' > .env
|
|
echo 'SESSION_SECRET="${{secrets.SESSION_SECRET}}"' >> .env
|
|
|
|
- name: ⚒ Install dependencies and build
|
|
run: yarn install && yarn build
|
|
|
|
- name: 🚀 Deploy
|
|
run: pm2 startOrRestart ecosystem.config.js
|