Skip to content

Replace .Site.IsServer with hugo.IsServer #74

Replace .Site.IsServer with hugo.IsServer

Replace .Site.IsServer with hugo.IsServer #74

name: Fresh to vercel PR
on:
pull_request:
jobs:
testBuild:
runs-on: ubuntu-latest
strategy:
matrix:
# 0.120.0 "minVersion"
# 0.135.0 "justAVersion"
# latest "latest"
hugo: ['0.120.0', '0.135.0', 'latest']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: ${{ matrix.hugo }}
extended: true
- name: Build with Hugo on PR
working-directory: exampleSite
run: hugo --minify
createExampleAndDeployToArtifacts:
runs-on: ubuntu-latest
needs: [testBuild]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: 'latest'
extended: true
- name: Build with Hugo on PR
working-directory: exampleSite
run: |
hugo \
--minify \
--baseURL https://hugo-fresh-${{ github.event.pull_request.head.user.login }}-${{ github.event.pull_request.head.ref }}.vercel.app
- name: Save hugo as artifact
uses: actions/upload-artifact@v4
with:
name: hugo-output
path: exampleSite/public/
- name: Save alias domain
run: |
mkdir -p ./alias-domain
echo hugo-fresh-${{ github.event.pull_request.head.user.login }}-${{ github.event.pull_request.head.ref }}.vercel.app > ./alias-domain/alias-domain
- name: Save alias domain as artifact
uses: actions/upload-artifact@v4
with:
name: alias-domain
path: alias-domain/