Skip to content

Commit 6f514bf

Browse files
Update deployment script
1 parent 8b88344 commit 6f514bf

3 files changed

Lines changed: 62 additions & 51 deletions

File tree

.github/workflows/Gemfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
source "https://rubygems.org"
2+
3+
gem "jekyll", "~> 4.3.2"
4+
5+
group :jekyll_plugins do
6+
gem "jekyll-feed", "~> 0.12"
7+
gem "jekyll-sitemap", "~> 1.4"
8+
gem "jekyll-scholar"
9+
gem "jekyll-regex-replace"
10+
gem "jekyll-sass-converter"
11+
end
12+
13+
gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
14+
gem "webrick", "~> 1.8"

.github/workflows/deploy.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Compile and Deploy Jekyll Website
2+
3+
on:
4+
push:
5+
branches:
6+
- deploy
7+
- master
8+
9+
jobs:
10+
build-and-deploy:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout Repository
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Ruby Environment
18+
uses: ruby/setup-ruby@v1
19+
with:
20+
ruby-version: '3.2'
21+
bundler-cache: true
22+
23+
- name: Compile Jekyll Artifacts
24+
run: |
25+
bundle install
26+
JEKYLL_ENV=production bundle exec jekyll build
27+
28+
- name: Install sshpass
29+
run: sudo apt-get update && sudo apt-get install -y sshpass
30+
31+
- name: Deploy via SFTP and Password
32+
env:
33+
PASSWORD: ${{ secrets.SERVER_PASSWORD }}
34+
HOST: ${{ secrets.SERVER_HOST }}
35+
USERNAME: ${{ secrets.SERVER_USERNAME }}
36+
PORT: ${{ secrets.SERVER_PORT }}
37+
TARGET: ${{ secrets.SERVER_TARGET_PATH }}
38+
run: |
39+
mkdir -p ~/.ssh
40+
ssh-keyscan -p $PORT -H $HOST >> ~/.ssh/known_hosts
41+
42+
cat <<EOF > batch.sftp
43+
lcd _site
44+
cd $TARGET
45+
put -r *
46+
EOF
47+
48+
sshpass -p "$PASSWORD" sftp -P $PORT -b batch.sftp $USERNAME@$HOST

.github/workflows/jekyll-gh-pages.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)