Skip to content

v1.0.18

v1.0.18 #11

Workflow file for this run

name: Deploy to VPS Server
on:
release:
types: [created]
jobs:
lint:
name: Lint files
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Lint files
run: yarn lint
- name: Typecheck files
run: npx tsc
build-app:
name: Build Application
runs-on: ubuntu-latest
needs: [lint]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Build the Next.js app
run: yarn build
env:
G_USER: ${{ secrets.G_USER }}
G_TOKEN: ${{ secrets.G_TOKEN }}
deploy:
name: Deploy to VPS Server
runs-on: ubuntu-latest
needs: [build-app]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up SSH key
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_VPS_IP: ${{ secrets.SSH_VPS_IP }}
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H "$SSH_VPS_IP" >> ~/.ssh/known_hosts
- name: Deploy via SSH
env:
SSH_USER: ${{ secrets.SSH_USER }}
SSH_VPS_IP: ${{ secrets.SSH_VPS_IP }}
run: |
ssh -i ~/.ssh/id_rsa "$SSH_USER"@"$SSH_VPS_IP" "
cd rnstudio.hu &&
git pull origin main &&
yarn install &&
yarn build &&
pm2 restart nextjs-app
"