-
Notifications
You must be signed in to change notification settings - Fork 2
42 lines (32 loc) · 983 Bytes
/
main.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: Deploy with Hugo
on:
push:
branches: [ bascht.com ]
pull_request:
branches: [ bascht.com ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Hugo setup
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 0.89.2
- name: Build
run: hugo --minify -d public_html
- name: SSH setup
if: github.ref == 'refs/heads/bascht.com'
env:
DEPLOY_KEY: ${{ secrets.deploy_key }}
KNOWN_HOSTS: ${{ secrets.known_hosts }}
run: |
mkdir -p ~/.ssh
echo "${KNOWN_HOSTS}" >> ~/.ssh/known_hosts
echo "${DEPLOY_KEY}" > ~/.ssh/my_rsync_key
echo "IdentityFile ~/.ssh/my_rsync_key" >> ~/.ssh/config
chmod -R 700 ~/.ssh
- name: Rsync deployment
if: github.ref == 'refs/heads/bascht.com'
run: |
rsync -avz -e ssh --exclude=_ --delete public_html/ [email protected]:/var/www/virtual/bascht/bascht.com/