Skip to content

Deploy to Development Server #19

Deploy to Development Server

Deploy to Development Server #19

name: Deploy to Development Server
on:
workflow_dispatch:
jobs:
check_linting:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: "latest"
- name: Install pnpm
uses: pnpm/[email protected]
with:
version: "latest"
- name: Install dependencies
run: pnpm i
- name: Lint code
run: pnpm format:check
deploy:
needs: check_linting
runs-on: ubuntu-latest
steps:
- name: Deploy to development server
uses: appleboy/[email protected]
with:
host: ${{ secrets.DEV_SERVER_HOST }}
username: ${{ secrets.DEV_SERVER_USERNAME }}
password: ${{ secrets.DEV_SERVER_PASSWORD }}
port: ${{ secrets.DEV_SERVER_PORT }}
script: |
cd Stuns-Aterbrukslabbet/
git checkout ${{ github.ref_name }}
git fetch origin ${{ github.ref_name }}
git reset --hard origin/${{ github.ref_name }}
pnpm build
sudo shutdown -r +1 "Rebooting in 1 minute"