# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Liens morts

on:
  schedule:    
  - cron: "0 0 * * *"

jobs:
  build:

    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [14.x]
        # See supported Node.js release schedule at https://nodejs.org/en/about/releases/

    steps:
    - uses: actions/checkout@v2
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v2
      with:
        node-version: ${{ matrix.node-version }}
    - run: npm i
    - run: npm run build
    - run: npm run start &
      env: 
        PORT: 3000

    # wait for the server to start responding. We expect Bad Request 400 once it starts listening.
    # so override the shell and have the last command be the : { null } command to force exit code 0.
    - run: wget --retry-connrefused --waitretry=5 --read-timeout=10 --timeout=15 -t 50 http://localhost:3000/sitemap.xml
    
    - run: |
        npm run check-broken-links

# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Liens morts

on:
  schedule:    
  - cron: "0 0 * * *"
  workflow_dispatch:

jobs:
  build:

    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [14.x]
        # See supported Node.js release schedule at https://nodejs.org/en/about/releases/

    steps:
    - uses: actions/checkout@v2
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v2
      with:
        node-version: ${{ matrix.node-version }}
    - run: npm i
    - run: npm run build
    - run: npm run start &
      env: 
        PORT: 3000

    # wait for the server to start responding. We expect Bad Request 400 once it starts listening.
    # so override the shell and have the last command be the : { null } command to force exit code 0.
    - run: wget --retry-connrefused --waitretry=5 --read-timeout=10 --timeout=15 -t 50 http://localhost:3000/sitemap.xml
    
    - run: |
        npm run check-broken-links

Add manual trigger on broken link check
Add manual trigger on broken link check