From 374d42e202ce9824fdcfbe8651dbe4cee5b23472 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Sat, 14 Dec 2024 17:46:38 +0100 Subject: [PATCH 1/2] Create html.yml --- .github/workflows/html.yml | 64 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/html.yml diff --git a/.github/workflows/html.yml b/.github/workflows/html.yml new file mode 100644 index 0000000..094a33b --- /dev/null +++ b/.github/workflows/html.yml @@ -0,0 +1,64 @@ +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow + +name: "HTML" + +on: + pull_request: null + push: + branches: + - "master" + +permissions: + contents: "read" + +concurrency: + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true + +jobs: + typos_check: + name: "Validator" + runs-on: "ubuntu-22.04" + timeout-minutes: 1 + steps: + - + name: "Checkout repository" + uses: "actions/checkout@v4.1.5" + - + name: "Setup Java" + uses: "actions/setup-java@v4.5.0" + with: + distribution: "temurin" + java-version: "21" + - + name: "Set up Node.js" + uses: "actions/setup-node@v4.1.0" + with: + node-version: "22" + check-latest: true + cache: "npm" + - + name: "Install The Nu Html Checker" + env: + GH_TOKEN: "${{ github.token }}" + run: | + set -o pipefail + mkdir -p "${{ runner.temp }}/validator" + RELEASE_ASSET_URL="$( + gh api /repos/validator/validator/releases/latest \ + --jq '."assets"[] | select(."name" | test("^vnu\\.jar_.+\\.zip$")) | ."browser_download_url"' + )" + wget --secure-protocol=TLSv1_3 --max-redirect=1 --retry-on-host-error --retry-connrefused --tries=3 \ + --quiet --output-document="${{ runner.temp }}/validator/vnu.zip" "${RELEASE_ASSET_URL}" + unzip -j -d "${{ runner.temp }}/validator" "${{ runner.temp }}/validator/vnu.zip" dist/vnu.jar + java -jar "${{ runner.temp }}/validator/vnu.jar" --version + - + name: "Install production dependencies" + run: "npm ci --omit=dev" + - + name: "Build website" + run: "npm run eleventy:build" + - + name: "Run validator" + run: | + java -jar "${{ runner.temp }}/validator/vnu.jar" dist/index.html From da5718c97f0b3623bd298dd2465f0e186d83dbd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Sat, 14 Dec 2024 19:20:11 +0100 Subject: [PATCH 2/2] fix --- .github/workflows/html.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/html.yml b/.github/workflows/html.yml index 094a33b..cf64634 100644 --- a/.github/workflows/html.yml +++ b/.github/workflows/html.yml @@ -16,7 +16,7 @@ concurrency: cancel-in-progress: true jobs: - typos_check: + validator: name: "Validator" runs-on: "ubuntu-22.04" timeout-minutes: 1 @@ -59,6 +59,6 @@ jobs: name: "Build website" run: "npm run eleventy:build" - - name: "Run validator" + name: "Run validator on the frontpage" run: | java -jar "${{ runner.temp }}/validator/vnu.jar" dist/index.html