-
Notifications
You must be signed in to change notification settings - Fork 16
52 lines (48 loc) · 1.81 KB
/
Copy pathcrawler.yml
File metadata and controls
52 lines (48 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Website Crawler
on:
# Manually select an env to deploy to
workflow_dispatch:
inputs:
deployment-env:
description: "Environment"
type: environment # will be prod, dev, dev-blue, or dev-green
required: true
default: dev
# Invoked via another workflow, value passed in by string
workflow_call:
inputs:
deployment-env:
description: "Environment to deploy to"
required: true
type: string
permissions:
contents: read
jobs:
crawler:
continue-on-error: true
name: "Crawl ${{inputs.deployment-env || 'dev'}}"
runs-on: ubuntu-latest
env:
url: ${{ inputs.deployment-env == 'prod' && 'https://www.mbta.com' || format('https://{0}.mbtace.com', inputs.deployment-env || 'dev') }}
steps:
- id: setup-beam
uses: erlef/setup-beam@54075bcc5e249e4758d363f27d099f55d843f124 # v1.24.1
with:
otp-version: "28.2"
elixir-version: "1.19.4"
- name: cache crawler
id: escript-cache
uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5.1.0
with:
path: ~/.mix/escripts
key: ${{runner.os}}-${{steps.setup-beam.outputs.elixir-version}}-${{steps.setup-beam.outputs.otp-version}}-crawler
- name: Install Crawler
if: steps.escript-cache.outputs.cache-hit != 'true'
run: mix escript.install --force github mbta/link_checker
- name: Run Crawler
run: |
echo "## Crawler results" >> $GITHUB_STEP_SUMMARY
echo "Compare against current [known broken links (link TBA)]()"
echo "\`\`\`shell" >> $GITHUB_STEP_SUMMARY
$HOME/.mix/escripts/crawler ${url} --num-workers 3 --sleep 350 2>&1 | sed 's/\x1b\[[0-9;]*m//g' | tee -a $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY