Skip to content

deps: bump golang.org/x/sync from 0.7.0 to 0.8.0 (#214) #27

deps: bump golang.org/x/sync from 0.7.0 to 0.8.0 (#214)

deps: bump golang.org/x/sync from 0.7.0 to 0.8.0 (#214) #27

name: Publish website
on:
push:
branches: ['main']
pull_request:
branches: ['main']
release:
types: ['released']
jobs:
github-pages:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.131.0'
extended: true
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.21
- name: Build website
if: github.event_name == 'release'
run: make website
- name: Deploy website
if: github.event_name == 'release'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./website
publish_branch: gh-pages
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
# Redeploy the dev site after a tagged release, because actions-gh-pages
# will remove all files (including the "dev" dir) from the publish branch
# before pushing changes. This behavior can be avoided using
# "keep_files: true", but that approach could lead to hard-to-debug issues
# and is discouraged by the actions-gh-pages authors.
#
# Also, build (but not deploy) the dev website during PRs for more
# testing.
- name: Build dev website
env:
HUGO_BASEURL: 'https://kevin-hanselman.github.io/dud/dev'
run: make website
- name: Deploy dev website
if: github.event_name == 'push'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./website
destination_dir: ./dev
publish_branch: gh-pages
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'