-
Notifications
You must be signed in to change notification settings - Fork 69
35 lines (35 loc) · 1.06 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
name: Deploy
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository code
uses: actions/checkout@v2
with:
submodules: true
- name: Install Hugo
run: sudo apt install hugo
- name: Minify HTML
run: hugo --minify
- name: Deploy
run: |
deploy_dir=public
# Ensure GitHub doesn't mess around with the uploaded file.
# Without the file, for example, files with an underscore in the name won't be
# included in the pages.
touch "${deploy_dir}/.nojekyll"
# Push the website to GitHub pages
cd "${deploy_dir}"
rm -rf .git
git init
git config user.name "Deploy from CI"
git config user.email ""
git add .
git commit -m "Deploy ${GITHUB_SHA} to gh-pages"
git push -f "https://x-token:${github_token}@github.com/${GITHUB_REPOSITORY}" master:gh-pages
env:
github_token: ${{ secrets.GITHUB_TOKEN }}