Skip to content

Merge pull request #472 from selinaZitrone/patch-1 #499

Merge pull request #472 from selinaZitrone/patch-1

Merge pull request #472 from selinaZitrone/patch-1 #499

Workflow file for this run

name: Build and deploy to GitHub Pages
on:
push:
branches:
- develop
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Read .env hugo version
id: hugo-version
run: |
. ./.env
echo "::set-output name=HUGO_VERSION::${HUGO_VERSION}"
echo "::set-output name=DOCSY_VERSION::${DOCSY_VERSION}"
- name: Add hugo nodejs dependencies
uses: actions/setup-node@v3
with:
node-version: "18"
cache: 'npm'
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
# sync versions with docker-compose .env ala
# https://github.com/marketplace/actions/hugo-setup#%EF%B8%8F-read-hugo-version-from-file
hugo-version: "${{ steps.hugo-version.outputs.HUGO_VERSION }}"
extended: true
- name: Build Hugo site
env:
HUGO_ENV: "production"
run: |
yarn install
hugo --minify --gc
- name: Deploy to Pages
if: github.event_name == 'push'
uses: peaceiris/actions-gh-pages@v3
env:
HUGO_ENV: "production"
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
publish_branch: main