From 62d6032738ccf2935359fa80296f63e12784a6a9 Mon Sep 17 00:00:00 2001 From: Fabian Rodriguez Date: Mon, 25 Nov 2024 10:33:38 +0100 Subject: [PATCH] Add scheduled broken-link-checker action --- .github/workflows/check-links-scheduled.yml | 71 +++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/check-links-scheduled.yml diff --git a/.github/workflows/check-links-scheduled.yml b/.github/workflows/check-links-scheduled.yml new file mode 100644 index 00000000..b38460f5 --- /dev/null +++ b/.github/workflows/check-links-scheduled.yml @@ -0,0 +1,71 @@ +name: Scheduled Broken Links Checker +on: + workflow_dispatch: + schedule: + - cron: '0 0 * * 0' + +concurrency: + cancel-in-progress: true + group: ${{ github.workflow }} + +env: + VITE_PORTAL_API_URL: ${{ vars.VITE_PORTAL_API_URL }} + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + with: + submodules: 'recursive' + + # Configure Ruby to build Jekyll site + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: .ruby-version + - name: Ruby gem cache + uses: actions/cache@v4 + with: + path: ${{ github.workspace }}/vendor/bundle + key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} + restore-keys: | + ${{ runner.os }}-gems- + - name: Bundle Setup + run: bundle config path ${{ github.workspace }}/vendor/bundle + - name: Bundle Install + run: bundle install --jobs 4 --retry 3 + + # Configure Node to build assets + - uses: actions/setup-node@v4 + with: + node-version: "20" + - name: Cache node modules + uses: actions/cache@v4 + env: + cache-name: cache-node-modules + with: + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + + # Build the Docs + - name: Build Docs + run: | + npm ci + exe/build + + - name: Run site + run: | + npm install -g wait-on + netlify dev & wait-on http://localhost:8888 + + - name: Run link checker + run: | + cd tools/broken-link-checker + npm ci + node full.js --host http://localhost:8888 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file