-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (31 loc) · 919 Bytes
/
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: Deploy website to gh-pages branch
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-20.04
steps:
- name: checkout repo & submodules
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
- name: Build the website
run: |
wget https://github.com/gohugoio/hugo/releases/download/v0.82.0/hugo_0.82.0_Linux-64bit.deb
sudo dpkg -i hugo_0.82.0_Linux-64bit.deb
hugo
working-directory: hugo_site
- name: Deploy contents of `hugo_site/public` to gh-pages docs dir
run: |
git config user.name "github-action"
git config user.email "github-action"
git checkout gh-pages
rm -rf docs/*
cp -rT hugo_site/public docs
rm -rf hugo_site
git add --all
git commit -m "deploy website" || echo "No changes to commit"
git push