Deploy to Development Server #4
This file contains hidden or 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 to Development Server | |
on: | |
workflow_dispatch: | |
jobs: | |
check_linting: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- 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 Main | |
git pull origin Main | |
pnpm prod | |
sudo systemctl reboot |