forked from viamrobotics/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (80 loc) · 2.61 KB
/
run-htmltest.yml
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# .github/workflows/run-htmltest.yml
# (c) 2021 Robb Romans
#
# Run htmltest link checker on generated HTML output in dist/
# https://github.com/wjdp/htmltest
#
name: run-htmltest-external
on:
schedule:
# 10am UTC on weekdays
- cron: '0 10 * * 1,2,3,4,5'
jobs:
htmltest-external:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
submodules: true # Fetch Hugo themes
fetch-depth: 1 # Fetch all history for .GitInfo and .Lastmod
- uses: actions/setup-go@v5
with:
go-version: '>=1.17.0'
- name: Set up Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "latest"
extended: true
- name: Get Date
id: get-date
run: |
echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT
shell: bash
- uses: actions/cache@v4
with:
path: resources
key: ${{ steps.get-date.outputs.date }}-hugo-resources-htmltest
- uses: actions/cache@v4
with:
path: node_modules
key: ${{ steps.get-date.outputs.date }}-hugo-node_modules
- name: Build
run: make build-dist-pr
- name: Test HTML
# https://github.com/wjdp/htmltest-action/
# Don't fail the build on broken links
id: test-html
continue-on-error: false
uses: wjdp/htmltest-action@master
with:
# For consistency, use the same config file as for local builds
config: .htmltest.yml
- name: Archive htmltest results
uses: actions/upload-artifact@v4
# Note: Set ACTIONS_RUNTIME_TOKEN env variable to test with nektos/act
with:
name: htmltest-report
path: tmp/.htmltest/htmltest.log
retention-days: 7 # Default is 90 days
- name: Login to Jira
if: failure()
uses: atlassian/gajira-login@v3
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
- name: Create Jira ticket
if: failure()
id: create
uses: atlassian/gajira-create@v3
env:
GITHUB_RUN_ID: ${{ github.run_id }}
with:
project: DOCS
issuetype: Bug
summary: Broken link detected
description: "For more info see https://github.com/viamrobotics/docs/actions/runs/${{ env.GITHUB_RUN_ID }}."
- name: Log created Jira issue
if: failure()
run: echo "Issue ${{ steps.create.outputs.issue }} was created"