forked from alshedivat/al-folio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Link checks on deploy (alshedivat#2079)
Added another GitHub action to check for broken local links on version of the site that will be deployed. The `broken-links` action check for broken links considering documentation files (like INSTALLING.md) and also pages like [_pages/about.md](https://github.com/alshedivat/al-folio/blob/master/_pages/about.md), but it can't check for broken links when the link will be handled by jekyll tags (like in [_pages/blog.md](https://github.com/alshedivat/al-folio/blob/master/_pages/blog.md). With `broken-links-site` we can check if all the links that will be used on the final site that refer to local files are correct. Focusing only on local files since this would end up calling too many checks for library files, like `https://unpkg.com/bootstrap-table@1.22.1/dist/bootstrap-table.min.css`. --------- Signed-off-by: George Araújo <george.gcac@gmail.com>
- Loading branch information
1 parent
96c7880
commit 5fd6aa1
Showing
3 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Check for broken links on site | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
pull_request: | ||
branches: | ||
- master | ||
- main | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
deploy: | ||
# available images: https://github.com/actions/runner-images#available-images | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v3 | ||
- name: Setup Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: "3.2.2" | ||
bundler-cache: true | ||
- name: Update _config.yml ⚙️ | ||
uses: fjogeleit/yaml-update-action@v0.13.1 | ||
with: | ||
commitChange: false | ||
valueFile: "_config.yml" | ||
changes: | | ||
{ | ||
"giscus.repo": "${{ github.repository }}", | ||
"baseurl": "" | ||
} | ||
- name: Install and Build 🔧 | ||
run: | | ||
pip3 install --upgrade jupyter | ||
npm install -g mermaid.cli | ||
npm install -g purgecss | ||
export JEKYLL_ENV=production | ||
bundle exec jekyll build --lsi | ||
purgecss -c purgecss.config.js | ||
- name: Link Checker 🔗 | ||
uses: lycheeverse/lychee-action@v1.9.0 | ||
with: | ||
fail: true | ||
# only check local links | ||
args: --offline --remap '_site(/?.*)/assets/(.*) _site/assets/$2' --verbose --no-progress '_site/**/*.html' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: deploy | ||
name: Deploy site | ||
|
||
on: | ||
push: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: prettier | ||
name: Prettier code formatter | ||
|
||
on: | ||
push: | ||
|