Skip to content

Commit 0b5032c

Browse files
committed
Update auto-publish scripts
1 parent a5e6b29 commit 0b5032c

File tree

3 files changed

+44
-25
lines changed

3 files changed

+44
-25
lines changed

.github/workflows/build.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Build
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
push:
7+
branches:
8+
- main
9+
jobs:
10+
build:
11+
name: Build
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Build
16+
run: ./compile.sh
17+
- name: Deploy
18+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
19+
uses: peaceiris/actions-gh-pages@v3
20+
with:
21+
github_token: ${{ secrets.GITHUB_TOKEN }}
22+
publish_dir: ./out

.travis.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

compile.sh

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,37 @@ fi
1010

1111
set -e # Exit with nonzero exit code if anything fails
1212

13-
echo Running bikeshed on index.src.html
14-
bikeshed -f spec ./index.src.html
15-
16-
for SPEC in $FILES; do
13+
for SPEC in index.src.html $FILES; do
1714
echo Running bikeshed on $SPEC
18-
bikeshed -f spec $SPEC
15+
if which bikeshed; then
16+
bikeshed -f spec $SPEC
17+
else
18+
SPEC_OUT=${SPEC%.bs}.html
19+
HTTP_STATUS=$(curl https://api.csswg.org/bikeshed/ \
20+
--output ${SPEC_OUT} \
21+
--write-out "%{http_code}" \
22+
--header "Accept: text/plain, text/html" \
23+
-F file=@${SPEC})
24+
if [ "$HTTP_STATUS" -ne "200" ]; then
25+
echo ""; cat $SPEC_OUT; echo ""
26+
rm -f $SPEC_OUT
27+
exit 1
28+
fi
29+
fi
1930
done
2031

2132
OUTDIR=${1:-out}
2233

34+
mkdir -p $OUTDIR
35+
2336
if [ -d $OUTDIR ]; then
24-
echo Copy index.html into $OUTDIR/index.html
25-
cp index.html $OUTDIR/index.html
37+
echo Move index.html into $OUTDIR/index.html
38+
mv index.html $OUTDIR/$SPEC_OUT
2639
for SPEC in $FILES; do
2740
SPEC_OUT=${SPEC%.bs}.html
2841
if [ -f $SPEC_OUT ]; then
29-
echo Copy $SPEC_OUT into $OUTDIR/$SPEC_OUT
30-
cp $SPEC_OUT $OUTDIR/$SPEC_OUT
42+
echo Move $SPEC_OUT into $OUTDIR/$SPEC_OUT
43+
mv $SPEC_OUT $OUTDIR/$SPEC_OUT
3144
fi
3245
done
3346
fi

0 commit comments

Comments
 (0)