Fix typing issue #2
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: | |
push: | |
branches: [main] | |
workflow_dispatch: | |
jobs: | |
deploy: | |
name: Do it πͺ | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout latest code π | |
uses: actions/checkout@v3 | |
- name: Restore cache π | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.npm | |
${{ github.workspace }}/.next/cache | |
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} | |
restore-keys: | | |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- | |
- name: Install dependencies β³ | |
run: npm ci | |
- name: Build website π·ββοΈ | |
run: npm run build | |
- name: Copy prisma folder πΎ | |
run: cp -R prisma/ .next/standalone/prisma/ | |
- name: Copy public folder π | |
run: cp -R public/ .next/standalone/public/ | |
- name: Copy static folder π | |
run: cp -R .next/static/ .next/standalone/.next/static/ | |
- name: Install SSH Key π | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
known_hosts: "just-a-placeholder-so-we-dont-get-errors" | |
- name: Adding Known Hosts πΎ | |
run: ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts | |
- name: Deploy with rsync π¨ | |
run: rsync -avz --delete .next/standalone/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/var/www/issue.robvermeer.nl/ --exclude=.env.local --exclude=database/ | |
# - name: Migrate database πͺ€ | |
# run: ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "cd /var/www/issue.robvermeer.nl/ && dotenv -e .env.local prisma migrate deploy" | |
# - name: Restart server π | |
# run: ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "cd /var/www/issue.robvermeer.nl/ && pm2 reload issue" |