-
Notifications
You must be signed in to change notification settings - Fork 6
47 lines (45 loc) · 1.34 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
43
44
45
46
47
name: Build
on: [push, pull_request]
jobs:
build:
name: Build site with Hugo
runs-on: ubuntu-20.04
strategy:
matrix:
hugo: ["0.88.1"]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download Hugo
run: |
wget https://github.com/gohugoio/hugo/releases/download/v${{ matrix.hugo }}/hugo_extended_${{ matrix.hugo }}_Linux-64bit.tar.gz
tar xvf hugo_extended_${{ matrix.hugo }}_Linux-64bit.tar.gz
- name: Build site
run: |
cd kotkt.nl
../hugo
- name: Upload site as artifact
uses: actions/upload-artifact@v2
with:
name: site
path: kotkt.nl/public/
deploy:
name: Deploy site to production
runs-on: ubuntu-20.04
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- name: Download website
uses: actions/download-artifact@v2
with:
name: site
path: site
- name: Upload website
uses: easingthemes/[email protected]
env:
SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
SOURCE: site/
REMOTE_HOST: ${{ secrets.DEPLOY_HOST }}
REMOTE_USER: ${{ secrets.DEPLOY_USER }}
TARGET: ${{ secrets.DEPLOY_TARGET }}
ARGS: "-rlgoDzvc -i --delete"