38 lines
802 B
YAML
38 lines
802 B
YAML
name: Build and Publish Artifact
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: '^1.20' # Use the specific Go version you need
|
|
|
|
- name: Setup Hugo
|
|
uses: peaceiris/actions-hugo@v2
|
|
with:
|
|
hugo-version: '0.122.0'
|
|
extended: true
|
|
|
|
- name: Build
|
|
run: hugo --minify
|
|
|
|
- name: Get the date
|
|
id: date
|
|
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
|
|
|
|
- name: Archive production artifacts
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: site-${{ steps.date.outputs.date }}
|
|
path: public/ |