Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc: reorganize GitHub Workflows #182

Merged
merged 2 commits into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 1 addition & 31 deletions .github/workflows/publish-release.yaml
Original file line number Diff line number Diff line change
@@ -1,40 +1,10 @@
name: Publish release
name: Publish release artifacts

on:
push:
tags: ['v*.*.*']

jobs:
github-pages:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Install Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.121.1'
extended: true

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.21

- name: Build website
run: make website

- name: Deploy website
uses: peaceiris/actions-gh-pages@v3
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'

goreleaser:
runs-on: ubuntu-20.04
steps:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Publish dev site
name: Publish website
on:
push:
branches: ['main']
tags-ignore: ['v*.*.*']
tags: ['v*.*.*']

jobs:
github-pages:
Expand All @@ -24,11 +24,30 @@ jobs:
go-version: 1.21

- name: Build website
if: github.ref_type == "tag"
run: make website

- name: Deploy website
if: github.ref_type == "tag"
uses: peaceiris/actions-gh-pages@v3
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.
- name: Build dev website
env:
HUGO_BASEURL: 'https://kevin-hanselman.github.io/dud/dev'
run: make website

- name: Deploy website
- name: Deploy dev website
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
Loading