Skip to content

Commit

Permalink
Create deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
druhtru authored Sep 7, 2024
1 parent 8d859e3 commit 5e12ef7
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Deploy Docusaurus Site to Server

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '16'

- name: Install dependencies
run: npm install

- name: Build the Docusaurus site
run: npm run build

- name: Deploy to Server via SSH
uses: appleboy/ssh-action@v0.1.2
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.DEPLOY_KEY }}
port: 22
script: |
cd /path/to/your/docusaurus/directory
rm -rf build
mv ~/path/to/build /path/to/your/docusaurus/directory/build
pm2 restart docusaurus

0 comments on commit 5e12ef7

Please sign in to comment.