Skip to content

Commit

Permalink
Updates CI to latest Hugo version
Browse files Browse the repository at this point in the history
  • Loading branch information
m1kola committed Apr 11, 2023
1 parent 6b6d136 commit 2325ee8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,19 @@ on: pull_request
jobs:
lint:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.111.1
HUGO_ENV: production
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: recursive

- name: Run linting script
run: ${PWD}/hack/ci/link-check.sh
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Checkout
uses: actions/checkout@v3
- name: Install Node.js dependencies
run: npm ci
- name: Build with Hugo
run: hugo
- name: Run linting script
run: ${PWD}/hack/ci/link-check.sh
12 changes: 1 addition & 11 deletions hack/ci/link-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,8 @@ set -ev

CONTAINER_RUN_EXTRA_OPTIONS=${CONTAINER_RUN_EXTRA_OPTIONS:=""}
CONTAINER_ENGINE=${CONTAINER_ENGINE:="docker"}
volume_name="olm-html"

function cleanup() {
exit_status=$?
${CONTAINER_ENGINE} volume rm ${volume_name}
exit $exit_status
}
trap cleanup EXIT

${CONTAINER_ENGINE} volume create ${volume_name}
${CONTAINER_ENGINE} run --rm ${CONTAINER_RUN_EXTRA_OPTIONS} -v "$(pwd):/src" -v ${volume_name}:/src/public klakegg/hugo:0.73.0-ext-ubuntu
# ignore
# 1: links going back to help.github.com are rate-limited and can make this flaky
# 2: docsy autogenerated edit links to original markdown source, which will fail if the markdown file is new
${CONTAINER_ENGINE} run --rm -v ${volume_name}:/target mtlynch/htmlproofer /target --ignore-empty-alt --ignore-status-codes 429 --allow-hash-href --ignore-urls '/help.github.com/,/edit\/master\/.*\.md/'
${CONTAINER_ENGINE} run --rm -v $(pwd)/public:/target mtlynch/htmlproofer /target --ignore-empty-alt --ignore-status-codes 429 --allow-hash-href --ignore-urls '/help.github.com/,/edit\/master\/.*\.md/,/tree\/master\/.*\.md/,/new\/master\/.*filename=change-me\.md/'

0 comments on commit 2325ee8

Please sign in to comment.