File tree Expand file tree Collapse file tree 3 files changed +48
-7
lines changed Expand file tree Collapse file tree 3 files changed +48
-7
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,18 @@ defaults:
20
20
run :
21
21
shell : bash
22
22
23
+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
24
+ permissions :
25
+ contents : write
26
+ pages : write
27
+ id-token : write
28
+ deployments : write
29
+
30
+ # Allow one concurrent deployment
31
+ concurrency :
32
+ group : " pages"
33
+ cancel-in-progress : true
34
+
23
35
jobs :
24
36
link-check :
25
37
if : ${{ github.repository == 'publiccodenet/publiccodenet-url-check' }}
36
48
make
37
49
python3
38
50
python3-docopt
39
- - run : make check
51
+ ruby
52
+ ruby-bundler
53
+ - name : bundle-install
54
+ run : bundle install
55
+ - name : fetch-previous-results
56
+ run : echo "once it is live, we can fetch the previous results"
57
+ - name : build-site
58
+ run : make build
59
+ - name : Deploy to GitHub Pages
60
+ id : deployment
61
+ uses : peaceiris/actions-gh-pages@v3
62
+ with :
63
+ github_token : ${{ secrets.GITHUB_TOKEN }}
64
+ publish_dir : ./_site
65
+ - name : report-failure-on-bad-urls
66
+ run : URL_CHECK_JUST_RAN=1 make check
Original file line number Diff line number Diff line change @@ -22,16 +22,29 @@ url-check/url-check.py:
22
22
update-url-check : url-check/url-check.py
23
23
git submodule update --init --recursive
24
24
25
- .PHONY :
25
+ .PHONY : check
26
26
check : url-check-config.json url-check/url-check.py check-no-fails.sh
27
27
./check-no-fails.sh
28
28
@echo SUCCESS $@
29
29
30
+ .PHONY : all
30
31
all : url-check/url-check.py
31
32
32
33
url-check-fails.json : url-check/url-check.py url-check-config.json
33
34
url-check/url-check.py
34
35
35
- serve : url-check-fails.json
36
- PAGES_REPO_NWO=publiccodenet/stpubliccodenet-url-check \
36
+ _site/index.html : index.md url-check-fails.json
37
+ PAGES_REPO_NWO=publiccodenet/publiccodenet-url-check \
38
+ bundle exec jekyll build
39
+
40
+ .PHONY : build
41
+ build : _site/index.html
42
+
43
+ .PHONY : serve
44
+ serve : _site/url-check-fails.json
45
+ PAGES_REPO_NWO=publiccodenet/publiccodenet-url-check \
37
46
bundle exec jekyll serve
47
+
48
+ .PHONY : clean
49
+ clean :
50
+ rm -rf _site
Original file line number Diff line number Diff line change 12
12
# -e Exit immediately if a command exits with a non-zero status.
13
13
set -e
14
14
15
- url-check/url-check.py $URL_CHECK_VERBOSE
16
- LINES=` wc -l url-check-fails.json | cut -f1 -d' ' `
17
- if [ $LINES -gt 1 ]; then
15
+ if [ " _${URL_CHECK_JUST_RAN} _" == " __" ]; then
16
+ url-check/url-check.py $URL_CHECK_VERBOSE
17
+ fi
18
+ if [ $( grep -c ' "failing"' url-check-fails.json) -ne 0 ]; then
18
19
echo
19
20
echo " Fails: $( grep -c ' "http' url-check-fails.json) "
20
21
echo
You can’t perform that action at this time.
0 commit comments