Skip to content

Commit

Permalink
automate playground compiler (#6449)
Browse files Browse the repository at this point in the history
  • Loading branch information
aspeddro authored Oct 27, 2023
1 parent cff0a81 commit fbbb84b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -371,3 +371,9 @@ jobs:
run: |
npm publish rescript-${{ needs.package.outputs.rescript_version }}.tgz --tag ci
npm publish rescript-std-${{ needs.package.outputs.rescript_version }}.tgz --tag ci
- name: Update Website Playground
env:
NEXT_REVALIDATE_SECRET_TOKEN: ${{ secrets.NEXT_REVALIDATE_SECRET_TOKEN }}
run: ./playground/website_update_playground.sh
shell: bash
19 changes: 19 additions & 0 deletions playground/website_update_playground.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#/usr/bin/sh

if [ -z "${NEXT_REVALIDATE_SECRET_TOKEN}" ]; then
echo "NEXT_REVALIDATE_SECRET_TOKEN environment variable not set."
exit 1
fi

echo "Sending request to rescript-lang.org/api/revalidate"

STATUS_CODE=$(curl -s -o /dev/null -w "%{http_code}" "https://rescript-lang.org/api/revalidate?secret=${NEXT_REVALIDATE_SECRET_TOKEN}")

if [[ "$STATUS_CODE" == 200 ]]; then
echo "Revalidation finished"
exit 0
fi

echo "Failed to revalidate"
echo "Status Code: $STATUS_CODE"
exit 1

0 comments on commit fbbb84b

Please sign in to comment.