From 0e562e8622e1eb55c0e5bcfd6caca573349ce86d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?George=20Ara=C3=BAjo?= Date: Mon, 15 Jan 2024 14:12:45 -0300 Subject: [PATCH] Created different workflow to check for broken links on _site MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: George AraΓΊjo --- .github/workflows/broken-links-site.yml | 48 +++++++++++++++++++++++++ .github/workflows/deploy.yml | 6 ---- 2 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/broken-links-site.yml diff --git a/.github/workflows/broken-links-site.yml b/.github/workflows/broken-links-site.yml new file mode 100644 index 000000000000..aa2eb9601237 --- /dev/null +++ b/.github/workflows/broken-links-site.yml @@ -0,0 +1,48 @@ +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' \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 57112ee6e1c4..908e32e5047a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -41,12 +41,6 @@ jobs: 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 '/al-folio/(.*) _site/$1' --verbose --no-progress '_site/**/*.html' - name: Deploy πŸš€ if: github.event_name != 'pull_request' uses: JamesIves/github-pages-deploy-action@v4