From 61bca0268084a0d6bd61e0d3c69b688f85da9172 Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Wed, 8 Sep 2021 14:20:40 -0400 Subject: [PATCH 1/9] Draft linkchecker Action. From https://clementbm.github.io/github%20action/jekyll/link%20checking/2020/05/31/automatically-validate-links-on-jekyll-website.html --- .github/workflows/checklinks.yml | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/checklinks.yml diff --git a/.github/workflows/checklinks.yml b/.github/workflows/checklinks.yml new file mode 100644 index 00000000..04052d7d --- /dev/null +++ b/.github/workflows/checklinks.yml @@ -0,0 +1,38 @@ +name: CheckLinks +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + checklinks: + name: Linux + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v2 + - name: Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6.x + - name: Setup Rubygems, Bundler, jekyll + run: | + gem update --system --no-document + gem update bundler --no-document + gem install jekyll bundler + bundle install + - name: Build jekyll website with drafts + run: bundle exec jekyll build --drafts + - name: Check for broken links + run: | + bundle exec htmlproofer --log-level :debug ./_site &> links.log + continue-on-error: true + - name: Archive log links + uses: actions/upload-artifact@v1 + with: + name: links-check.log + path: links.log From f53455f406e3444db6a20605e2fa01f16bebd135 Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Wed, 8 Sep 2021 14:53:47 -0400 Subject: [PATCH 2/9] Let's give this a try. --- .github/workflows/checklinks.yml | 38 ------------------------------- .github/workflows/jekyll.yml | 39 +++++++++++++++++++++++++++----- 2 files changed, 33 insertions(+), 44 deletions(-) delete mode 100644 .github/workflows/checklinks.yml diff --git a/.github/workflows/checklinks.yml b/.github/workflows/checklinks.yml deleted file mode 100644 index 04052d7d..00000000 --- a/.github/workflows/checklinks.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: CheckLinks -on: - push: - branches: - - main - pull_request: - branches: - - main - -jobs: - checklinks: - name: Linux - runs-on: ubuntu-latest - strategy: - fail-fast: false - steps: - - uses: actions/checkout@v2 - - name: Ruby - uses: actions/setup-ruby@v1 - with: - ruby-version: 2.6.x - - name: Setup Rubygems, Bundler, jekyll - run: | - gem update --system --no-document - gem update bundler --no-document - gem install jekyll bundler - bundle install - - name: Build jekyll website with drafts - run: bundle exec jekyll build --drafts - - name: Check for broken links - run: | - bundle exec htmlproofer --log-level :debug ./_site &> links.log - continue-on-error: true - - name: Archive log links - uses: actions/upload-artifact@v1 - with: - name: links-check.log - path: links.log diff --git a/.github/workflows/jekyll.yml b/.github/workflows/jekyll.yml index f01cc1a0..d7510dcb 100644 --- a/.github/workflows/jekyll.yml +++ b/.github/workflows/jekyll.yml @@ -12,9 +12,36 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Build the site in the jekyll/builder container - run: | - docker run \ - -v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \ - jekyll/builder:latest /bin/bash -c "chmod 777 /srv/jekyll && jekyll build --future" + + - name: Build the site in the jekyll/builder container + uses: actions/checkout@v2 + run: | + docker run \ + -v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \ + jekyll/builder:latest /bin/bash -c "chmod 777 /srv/jekyll && jekyll build --future" + + - name: Archive build files + uses: actions/upload-artifact@v2 + with: + name: build_files + path: ${{ github.workspace }}/_site/ + + linkchecker: + + runs-on: yarikoptic/linkchecker:9.4.0.anchorfix1-1 + + steps: + - name: Download build files + uses: actions/download-artifact@v2 + with: + name: build_files + + - name: Run linkchecker + uses: actions/checkout@v2 + run: | + linkchecker -t 1 ${{ github.workspace }}/_site + + # check external separately by pointing to all *html so no + # failures for local file:/// -- yoh found no better way, + linkchecker -t 1 --check-extern \ + ${{ github.workspace }}/_site/*html ${{ github.workspace }}/_site/*/*.html From 468010c998ec1fa8d6149c3a99a5e88586f46897 Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Wed, 8 Sep 2021 14:57:51 -0400 Subject: [PATCH 3/9] Fix. --- .github/workflows/jekyll.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/jekyll.yml b/.github/workflows/jekyll.yml index d7510dcb..ce7b4850 100644 --- a/.github/workflows/jekyll.yml +++ b/.github/workflows/jekyll.yml @@ -21,10 +21,10 @@ jobs: jekyll/builder:latest /bin/bash -c "chmod 777 /srv/jekyll && jekyll build --future" - name: Archive build files - uses: actions/upload-artifact@v2 - with: - name: build_files - path: ${{ github.workspace }}/_site/ + uses: actions/upload-artifact@v2 + with: + name: build_files + path: ${{ github.workspace }}/_site/ linkchecker: From 71e1b6efa26bb5915e2bdf35971604de0c2f6578 Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Wed, 8 Sep 2021 14:58:30 -0400 Subject: [PATCH 4/9] Fix? --- .github/workflows/jekyll.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/jekyll.yml b/.github/workflows/jekyll.yml index ce7b4850..ea59e443 100644 --- a/.github/workflows/jekyll.yml +++ b/.github/workflows/jekyll.yml @@ -14,7 +14,6 @@ jobs: steps: - name: Build the site in the jekyll/builder container - uses: actions/checkout@v2 run: | docker run \ -v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \ @@ -37,7 +36,6 @@ jobs: name: build_files - name: Run linkchecker - uses: actions/checkout@v2 run: | linkchecker -t 1 ${{ github.workspace }}/_site From 6637c725acc566add2ef44a358bc27cd2b898855 Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Wed, 8 Sep 2021 15:02:00 -0400 Subject: [PATCH 5/9] Try using lychee. --- .github/workflows/jekyll.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/jekyll.yml b/.github/workflows/jekyll.yml index ea59e443..e0cf9d1d 100644 --- a/.github/workflows/jekyll.yml +++ b/.github/workflows/jekyll.yml @@ -27,7 +27,7 @@ jobs: linkchecker: - runs-on: yarikoptic/linkchecker:9.4.0.anchorfix1-1 + runs-on: ubuntu-latest steps: - name: Download build files @@ -35,11 +35,9 @@ jobs: with: name: build_files - - name: Run linkchecker - run: | - linkchecker -t 1 ${{ github.workspace }}/_site - - # check external separately by pointing to all *html so no - # failures for local file:/// -- yoh found no better way, - linkchecker -t 1 --check-extern \ - ${{ github.workspace }}/_site/*html ${{ github.workspace }}/_site/*/*.html + - name: Link Checker + uses: lycheeverse/lychee-action@v1.0.8 + with: + args: --verbose --no-progress ${{ github.workspace }}/_site/**/*.md ${{ github.workspace }}/_site/**/*.html + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} From 459fa4c98a547d93a54ced1358efee61d96ae47a Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Wed, 8 Sep 2021 15:07:41 -0400 Subject: [PATCH 6/9] Try again :cry: --- .github/workflows/jekyll.yml | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/workflows/jekyll.yml b/.github/workflows/jekyll.yml index e0cf9d1d..fc625c7b 100644 --- a/.github/workflows/jekyll.yml +++ b/.github/workflows/jekyll.yml @@ -25,15 +25,38 @@ jobs: name: build_files path: ${{ github.workspace }}/_site/ + build: + + runs-on: ubuntu-latest + + steps: + + - name: Build the site in the jekyll/builder container + run: | + docker run \ + -v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \ + jekyll/builder:latest /bin/bash -c "chmod 777 /srv/jekyll && jekyll build --future" + linkchecker: runs-on: ubuntu-latest steps: - - name: Download build files - uses: actions/download-artifact@v2 + + - name: Ruby + uses: actions/setup-ruby@v1 with: - name: build_files + ruby-version: 2.6.x + + - name: Setup Rubygems, Bundler, jekyll + run: | + gem update --system --no-document + gem update bundler --no-document + gem install jekyll bundler + bundle install + + - name: Build jekyll website with drafts + run: bundle exec jekyll build --drafts - name: Link Checker uses: lycheeverse/lychee-action@v1.0.8 From a141aa4799c9303e62dc0d724640120c6a6a6c89 Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Wed, 8 Sep 2021 15:08:40 -0400 Subject: [PATCH 7/9] I don't even know how that happened. --- .github/workflows/jekyll.yml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/.github/workflows/jekyll.yml b/.github/workflows/jekyll.yml index fc625c7b..49f04e90 100644 --- a/.github/workflows/jekyll.yml +++ b/.github/workflows/jekyll.yml @@ -7,23 +7,6 @@ on: branches: [ main ] jobs: - build: - - runs-on: ubuntu-latest - - steps: - - - name: Build the site in the jekyll/builder container - run: | - docker run \ - -v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \ - jekyll/builder:latest /bin/bash -c "chmod 777 /srv/jekyll && jekyll build --future" - - - name: Archive build files - uses: actions/upload-artifact@v2 - with: - name: build_files - path: ${{ github.workspace }}/_site/ build: From 13f76b586dcfa7260d1103e5a028e740eb9f2dfe Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Wed, 8 Sep 2021 15:15:56 -0400 Subject: [PATCH 8/9] Maybe I need the checkout? --- .github/workflows/jekyll.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/jekyll.yml b/.github/workflows/jekyll.yml index 49f04e90..3182a355 100644 --- a/.github/workflows/jekyll.yml +++ b/.github/workflows/jekyll.yml @@ -26,12 +26,14 @@ jobs: steps: + - uses: actions/checkout@v2 + - name: Ruby uses: actions/setup-ruby@v1 with: ruby-version: 2.6.x - - name: Setup Rubygems, Bundler, jekyll + - name: Set up Rubygems, Bundler, jekyll run: | gem update --system --no-document gem update bundler --no-document From 20cac5f8cfb3825369850bc851db716bba6c62b1 Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Wed, 8 Sep 2021 15:24:15 -0400 Subject: [PATCH 9/9] There's an extra folder. I mean, why? --- .github/workflows/jekyll.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/jekyll.yml b/.github/workflows/jekyll.yml index 3182a355..34f39659 100644 --- a/.github/workflows/jekyll.yml +++ b/.github/workflows/jekyll.yml @@ -46,6 +46,6 @@ jobs: - name: Link Checker uses: lycheeverse/lychee-action@v1.0.8 with: - args: --verbose --no-progress ${{ github.workspace }}/_site/**/*.md ${{ github.workspace }}/_site/**/*.html + args: --verbose --no-progress _site/**/*.md _site/**/*.html env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}