-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (36 loc) · 1.1 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
---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow
name: Hugo CI & Deploy
on:
push:
branches:
- main
jobs:
build:
name: Build and deploy website
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Setup Hugo
run: make setup
- name: Build website with Hugo
run: make build
- name: Deploy website with rsync
uses: burnett01/rsync-deployments@5.2.1
with:
switches: -avzr --quiet --delete
path: public/
remote_path: ${{ secrets.REMOTE_PATH }}
remote_host: ${{ secrets.REMOTE_HOST }}
remote_user: ${{ secrets.REMOTE_USER }}
remote_key: ${{ secrets.REMOTE_KEY }}
- name: Set file permissions
uses: appleboy/ssh-action@v0.1.8
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.REMOTE_KEY }}
script: "sudo chown -R ${{ secrets.REMOTE_USER }}:www-data ${{ secrets.REMOTE_PATH }}"