Skip to content

Commit fbbb84b

Browse files
authored
automate playground compiler (#6449)
1 parent cff0a81 commit fbbb84b

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

.github/workflows/ci.yml

+6
Original file line numberDiff line numberDiff line change
@@ -371,3 +371,9 @@ jobs:
371371
run: |
372372
npm publish rescript-${{ needs.package.outputs.rescript_version }}.tgz --tag ci
373373
npm publish rescript-std-${{ needs.package.outputs.rescript_version }}.tgz --tag ci
374+
375+
- name: Update Website Playground
376+
env:
377+
NEXT_REVALIDATE_SECRET_TOKEN: ${{ secrets.NEXT_REVALIDATE_SECRET_TOKEN }}
378+
run: ./playground/website_update_playground.sh
379+
shell: bash
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#/usr/bin/sh
2+
3+
if [ -z "${NEXT_REVALIDATE_SECRET_TOKEN}" ]; then
4+
echo "NEXT_REVALIDATE_SECRET_TOKEN environment variable not set."
5+
exit 1
6+
fi
7+
8+
echo "Sending request to rescript-lang.org/api/revalidate"
9+
10+
STATUS_CODE=$(curl -s -o /dev/null -w "%{http_code}" "https://rescript-lang.org/api/revalidate?secret=${NEXT_REVALIDATE_SECRET_TOKEN}")
11+
12+
if [[ "$STATUS_CODE" == 200 ]]; then
13+
echo "Revalidation finished"
14+
exit 0
15+
fi
16+
17+
echo "Failed to revalidate"
18+
echo "Status Code: $STATUS_CODE"
19+
exit 1

0 commit comments

Comments
 (0)