Skip to content

Build website using build/build.go #109

Build website using build/build.go

Build website using build/build.go #109

Workflow file for this run

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