-
Notifications
You must be signed in to change notification settings - Fork 44
42 lines (41 loc) · 1.29 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }}
restore-keys: |
${{ runner.os }}-gems-
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler-cache: true
- name: jekyll build
run: bundle exec jekyll build
- name: rsync
if: ${{github.event_name=='push' && github.ref=='refs/heads/master'}}
env:
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
DEPLOY_PORT: ${{ secrets.DEPLOY_PORT }}
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
DEPLOY_KNOWN_HOSTS: ${{ secrets.DEPLOY_KNOWN_HOSTS }}
DEPLOY_SRC: ./_site/
DEPLOY_DEST: public_html/pages
run: |
echo "$DEPLOY_KEY" > pk
echo "$DEPLOY_KNOWN_HOSTS" > kh
chmod 600 pk
rsync --compress --recursive --checksum --itemize-changes \
-e "ssh -p \"$DEPLOY_PORT\" -i pk -o 'UserKnownHostsFile kh'" \
$DEPLOY_SRC $DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_DEST