-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (36 loc) · 1.13 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
37
38
39
40
name: deploy
on:
push:
branches: [ source ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install hugo
run: |
echo "Installing Hugo"
mkdir -p /tmp/hugo/
curl -L https://github.com/gohugoio/hugo/releases/download/v0.66.0/hugo_extended_0.66.0_Linux-64bit.tar.gz | tar -zxf - --directory /tmp/hugo/
- name: Run hugo
run: |
git submodule update --init --recursive
/tmp/hugo/hugo version
echo $PWD
/tmp/hugo/hugo --minify --verbose --destination /tmp/output
- name: Commit files
run: |
git config --local user.email "actions@github.com"
git config --local user.name "github-actions"
git checkout -b master
ls | xargs rm -rf
cp -r /tmp/output/* ./
git add .
git commit -m "Update website"
git show-ref
- name: Push to github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git remote add publisher https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
git push publisher master --force