-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (34 loc) · 1.04 KB
/
deploy.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
name: Upload
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.1"
bundler-cache: true
- name: install dependencies
run: |
bundle config set --local path 'vendor/bundle'
bundle install
- name: build
run: bundle exec jekyll build
- name: upload
env:
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
DEPLOY_PATH: ${{ secrets.DEPLOY_PATH }}
run: |
mkdir -p ~/.ssh
ssh-keyscan -t rsa "$DEPLOY_HOST" 2> /dev/null | sort -u -o ~/.ssh/known_hosts
echo "$DEPLOY_KEY" > ~/.ssh/deploy_key
eval "$(ssh-agent -s)"
chmod 600 ~/.ssh/deploy_key
ssh-add ~/.ssh/deploy_key
rsync -rq --links --delete --exclude=".*" ./_site/ "$DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH"