Skip to content

Commit 0452585

Browse files
committed
sketch-in push to gh-pages
1 parent 164c343 commit 0452585

File tree

3 files changed

+48
-7
lines changed

3 files changed

+48
-7
lines changed

.github/workflows/link-check.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@ defaults:
2020
run:
2121
shell: bash
2222

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+
2335
jobs:
2436
link-check:
2537
if: ${{ github.repository == 'publiccodenet/publiccodenet-url-check' }}
@@ -36,4 +48,19 @@ jobs:
3648
make
3749
python3
3850
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

Makefile

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,29 @@ url-check/url-check.py:
2222
update-url-check: url-check/url-check.py
2323
git submodule update --init --recursive
2424

25-
.PHONY:
25+
.PHONY: check
2626
check: url-check-config.json url-check/url-check.py check-no-fails.sh
2727
./check-no-fails.sh
2828
@echo SUCCESS $@
2929

30+
.PHONY: all
3031
all: url-check/url-check.py
3132

3233
url-check-fails.json: url-check/url-check.py url-check-config.json
3334
url-check/url-check.py
3435

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 \
3746
bundle exec jekyll serve
47+
48+
.PHONY: clean
49+
clean:
50+
rm -rf _site

check-no-fails.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ fi
1212
# -e Exit immediately if a command exits with a non-zero status.
1313
set -e
1414

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
1819
echo
1920
echo "Fails: $(grep -c '"http' url-check-fails.json)"
2021
echo

0 commit comments

Comments
 (0)