Thanks to visit codestin.com
Credit goes to github.com

Skip to content
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
15 changes: 6 additions & 9 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,24 @@ jobs:
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Approve patch and minor updates
if: ${{steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch' || steps.dependabot-metadata.outputs.update-type == 'version-update:semver-minor'}}
run: gh pr review $PR_URL --approve -b "I'm **approving** this pull request because **it includes a patch or minor update**"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Approve major updates of development dependencies
if: ${{steps.dependabot-metadata.outputs.update-type == 'version-update:semver-major' && steps.dependabot-metadata.outputs.dependency-type == 'direct:development'}}
run: gh pr review $PR_URL --approve -b "I'm **approving** this pull request because **it includes a major update of a dependency used only in development**"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Comment on major updates of non-development dependencies
if: ${{steps.dependabot-metadata.outputs.update-type == 'version-update:semver-major' && steps.dependabot-metadata.outputs.dependency-type == 'direct:production'}}

- name: Comment on major updates of any dependencies
if: ${{steps.dependabot-metadata.outputs.update-type == 'version-update:semver-major'}}
run: |
gh pr comment $PR_URL --body "I'm **not approving** this PR because **it includes a major update of a dependency used in production**"
gh pr comment $PR_URL --body "I'm **not approving** this PR because **it includes a major update of a dependency**"
gh pr edit $PR_URL --add-label "requires-manual-qa"
env:
PR_URL: ${{github.event.pull_request.html_url}}
Expand Down
62 changes: 49 additions & 13 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,74 @@
name: lint & build
name: Lint & build
on:
workflow_dispatch:
push:
tags:
- v*
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
env:
CACHE_KEY: 'hugo-hinode-docs'
CACHE_PATH_DEBIAN: '/tmp/hugo_cache_runner'
CACHE_PATH_WIN: '~\AppData\Local\hugo_cache'
CACHE_PATH_MAC: '/Users/runner/Library/Caches/hugo_cache'

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

- name: Perform clean install of npm
run: npm ci

- name: Lint the source files
run: npm run lint

build:
needs: lint

strategy:
matrix:
node-version: [18.x, 20.x]
os: [macos-latest, windows-latest, ubuntu-latest]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
node-version: [18.x, 20.x]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
- name: Check out repository
uses: actions/checkout@v3

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- run: npm ci
- run: npm run lint

- uses: actions/cache@v3
- name: Perform clean install of npm
run: npm ci

# Cache Hugo cachedir and resourcedir (configured in config/ci/hugo.toml) for each OS
# No additional cache invalidation is needed, Hugo uses checksums itself
- name: Use Hugo cache
uses: actions/cache@v3
with:
path: /tmp/hugo_cache_runner
key: ${{ runner.os }}-hugo-hinodedocs
path: ${{ runner.os == 'Windows' && env.CACHE_PATH_WIN || runner.os == 'macOS' && env.CACHE_PATH_MAC || env.CACHE_PATH_DEBIAN }}
key: ${{ runner.os }}-${{ env.CACHE_KEY }}
restore-keys: |
${{ runner.os }}-hugo-hinodedocs
${{ runner.os }}-${{ env.CACHE_KEY }}

- run: npm run build:cache
- name: Build main site
run: npm run build:cache
58 changes: 58 additions & 0 deletions .github/workflows/mod-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Update Hugo dependencies
on:
workflow_dispatch:
schedule:
- cron: '0 3 * * *' # run daily at 03:00 AM

permissions:
pull-requests: write

jobs:
update-mod:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

- name: Perform clean install of npm
run: npm ci

- name: Update Hugo module dependencies
id: mod-updates
run: |
MOD_OUTPUT=$(npm run mod:update 2>&1)
echo "$MOD_OUTPUT"
MOD_UPDATES=$(echo "$MOD_OUTPUT" | grep '^go: upgraded' | sed 's/go: / - /' | sort -u)
echo 'MOD_UPDATES<<EOF' >> $GITHUB_OUTPUT
echo "$MOD_UPDATES" >> "$GITHUB_OUTPUT"
echo 'EOF' >> $GITHUB_OUTPUT

- name: Create Pull Request
uses: gethinode-actions/create-pull-request@v5
with:
token: ${{ secrets.HUGO_MOD_PR }}
commit-message: 'fix: update Hugo module dependencies'
committer: GitHub <[email protected]>
branch: hugo-mod-dependencies
delete-branch: true
title: 'Update Hugo module dependencies'
body: |
This PR is auto-generated by [create-pull-request][1].

Changes to go.mod:

${{ steps.mod-updates.outputs.MOD_UPDATES }}

[1]: https://github.com/peter-evans/create-pull-request
labels: dependencies
add-paths: |
go.mod
go.sum
39 changes: 0 additions & 39 deletions .github/workflows/update.yml

This file was deleted.

Binary file added assets/img/cogs.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions config/_default/params.toml
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@
github_actions = "https://github.com/features/actions"
github_cli = "https://cli.github.com"
github_signup = "https://github.com/signup"
github_plans = "https://docs.github.com/en/get-started/learning-about-github/githubs-plans"
github_pr = "https://help.github.com/articles/about-pull-requests/"
github_rebase = "https://help.github.com/articles/about-git-rebase/"
github_aefly = "https://github.com/aefly"
Expand Down Expand Up @@ -308,6 +309,7 @@
hugo_sass = "https://discourse.gohugo.io/t/using-the-dart-sass-transpiler"
hugo_toc = "https://gohugo.io/content-management/toc"
hugo_vars = "https://discourse.gohugo.io/t/initialize-sass-variables-from-hugo-templates"
hugo_issue_10719 = "https://github.com/gohugoio/hugo/issues/10719"
initialcommit = "https://initialcommit.com/blog/git-commit-messages-best-practices"
issue_tracker = "https://github.com/gethinode/hinode/issues"
katex = "https://katex.org"
Expand All @@ -333,6 +335,7 @@
netlify = "https://www.netlify.com"
netlify_cache = "https://www.netlify.com/blog/2017/02/23/better-living-through-caching/"
netlify_rewrite = "https://docs.netlify.com/routing/redirects/rewrites-proxies/"
nicolasiensen = "https://nicolasiensen.github.io/2022-07-23-automating-dependency-updates-with-dependabot-github-auto-merge-and-github-actions/"
nodejs = "https://nodejs.org"
npm = "https://www.npmjs.com"
npm_cpy = "https://www.npmjs.com/package/cpy"
Expand Down
25 changes: 23 additions & 2 deletions config/ci/hugo.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,23 @@
cachedir = '/tmp/hugo_cache_runner/'
resourcedir = '/tmp/hugo_cache_runner/resources/'
# cachedir default on POSIX: '/tmp/hugo_cache_runner'
# cachedir default on Windows: '~\AppData\Local\hugo_cache'
# cachedir default on macOS: '/Users/runner/Library/Caches/hugo_cache'

[caches]
[caches.assets]
dir = ':cacheDir/resources/_gen' # map to cacheDir instead of resourceDir to utilize GitHub action/cache
maxAge = -1
[caches.getcsv]
dir = ':cacheDir/:project'
maxAge = -1
[caches.getjson]
dir = ':cacheDir/:project'
maxAge = -1
[caches.getresource]
dir = ':cacheDir/:project'
maxAge = -1
[caches.images]
dir = ':cacheDir/resources/_gen' # map to cacheDir instead of resourceDir to utilize GitHub action/cache
maxAge = -1
[caches.modules]
dir = ':cacheDir/modules'
maxAge = -1
5 changes: 4 additions & 1 deletion content/en/docs/latest/getting-started/troubleshooting.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Troubleshooting
description: Review common issues and resolutions.
date: 2023-08-04
date: 2023-08-21
layout: docs
---

Expand Down Expand Up @@ -40,5 +40,8 @@ Review the table below for some common issues and their potential cause. Please
{{< accordion-item header="My local files are ignored" >}}
Hinode uses mounts to create a virtual file system. Be sure to include mounts for the base repository and the current repository. See the documentation about [mounted folders]({{< relref "../advanced-settings/overview#mounted-folders" >}}) for more details.
{{< /accordion-item >}}
{{< accordion-item header="Enabling purging of styles throws an error" >}}
Setting `purge = true` in the `style` section of your site parameters instructs Hinode to purge any unused styles from your generated stylesheet. The purger requires several npm packages to be installed, else it will throw an error such as `Cannot find module '@fullhuman/postcss-purgecss'`. You can use the {{</* link repository_template >}}Hinode template{{< /link */>}} as a starting point to set up npm and the required packages. Refer to the {{</* link "guides/optimization" >}}optimization guide{{< /link */>}} for more context.
{{< /accordion-item >}}
{{< /accordion >}}
<!-- markdownlint-enable MD036 MD037 -->
Loading