-
-
Notifications
You must be signed in to change notification settings - Fork 2
60 lines (52 loc) · 1.54 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
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Build website using build/build.go
on:
workflow_dispatch:
schedule:
- cron: '0 0 1 * *'
push:
paths:
- '*' # Run workflow for all file paths
- 'build/**'
- 'content/**'
- 'static/**'
- 'themes/**'
- '!/docs/*' # Don't run workflow when files are only in the /docs directory
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-22.04
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: 1.21
id: go
- name: Check out code into the Go module directory
env:
advice.detachedHead: false
uses: actions/checkout@master
- name: Install Hugo
run: |
curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest | grep "browser_download_url.*hugo_[^extended].*_linux-amd64\.deb" | cut -d ":" -f 2,3 | tr -d \" | wget -qi -
package="$(find . -name "*_linux-amd64.deb")"
sudo dpkg -i $package
which hugo
hugo version
rm -rf *.deb
- name: Checkout Master
run: git checkout master
- name: Run Build Program
run: |
cd build/
go mod tidy
go run .
- name: Commit Changes
run: |
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"
git config --global user.name "Github Actions"
git add .
git commit -m "New build"
git remote set-url origin https://ldrrp:${{ secrets.PERSONAL }}@github.com/${{ github.repository }}.git
git push origin master