Skip to content

Commit

Permalink
Create deploy-blog.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
alibabaedge authored Jun 28, 2024
1 parent 1b98242 commit 39bc1c5
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/deploy-blog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Deploy Blog

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-20.04

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node.js 20
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'

- name: Install Jekyll and Bundler
run: |
gem install jekyll bundler
bundle install
- name: Deploy to server
env:
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }}
run: |
sshpass -p ${SSH_PASSWORD} ssh -o StrictHostKeyChecking=no ${SSH_USERNAME}@${SSH_HOST} "
cd ~
rm -rf validatorinfo-blog
git clone https://github.com/citizenweb3/validatorinfo-blog.git
cd validatorinfo-blog
bundle install
bundle exec jekyll build
nohup bundle exec jekyll serve &> jekyll.log &
"

0 comments on commit 39bc1c5

Please sign in to comment.