Skip to content

Check secrets sended to workflow #4

Check secrets sended to workflow

Check secrets sended to workflow #4

Workflow file for this run

name: Deploy App
on:
push:
branches: [ production ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Test
env:
test_host: ${{ secrets.HOST }}
test_key: ${{ secrets.KEY }}
run: |
echo $test_host
echo $test_key
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.JS
uses: actions/setup-node@v3
with:
node-version: '18.X'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Show files
run: ls -al
- name: Copy missing folders
run: |
cp -r ./public ./.next/standalone/
cp -r ./.next/static ./.next/standalone/.next/
cp -r ./prisma ./.next/standalone/
- name: Zip App
run: zip -r app.zip ./.next/standalone
- name: Upload zip App to server
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
port: ${{ secrets.PORT }}
source: "./.next/standalone/app.zip"
target: ${{ secrets.APP_PATH }}
- name: Run commands in server
uses: appleboy/ssh-action@v1.0.3
env:
APP_PATH: ${{ secrets.APP_PATH }}
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
port: ${{ secrets.PORT }}
script: |
unzip -o "$APP_PATH/app.zip"
npm ci --include prod
npx prisma db push
pm2 restart notify-app