From 00ee19e9b68d98451b11eb3db70e0677d37f5cdb Mon Sep 17 00:00:00 2001 From: Mikalai Radchuk Date: Tue, 7 Mar 2023 14:49:19 +0000 Subject: [PATCH] Updates CI to latest Hugo version Signed-off-by: Mikalai Radchuk --- .github/workflows/lint.yaml | 22 +++++++++++++++------- hack/ci/link-check.sh | 12 +----------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 07554fdc..28e9c299 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -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 diff --git a/hack/ci/link-check.sh b/hack/ci/link-check.sh index 5fa7a1fe..6f340e1f 100755 --- a/hack/ci/link-check.sh +++ b/hack/ci/link-check.sh @@ -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/'