File tree Expand file tree Collapse file tree 2 files changed +37
-29
lines changed
Expand file tree Collapse file tree 2 files changed +37
-29
lines changed Original file line number Diff line number Diff line change 1- name : Deploy Website
1+ name : Deploy
22
33on :
44 push :
4040 - name : Deploy to GitHub Pages
4141 uses : peaceiris/actions-gh-pages@v4
4242 with :
43- github_token : ${{ secrets.GITHUB_TOKEN }}
4443 publish_dir : ./dist
4544 publish_branch : gh-pages
4645 cname : jihoon.me
4746 force_orphan : true
47+
48+ crawl :
49+ needs : build-and-deploy
50+ runs-on : ubuntu-latest
51+ if : github.ref == 'refs/heads/main'
52+
53+ steps :
54+ - name : Wait for deployment
55+ run : sleep 30
56+
57+ - name : Verify website is accessible
58+ run : |
59+ curl -f -s -o /dev/null https://jihoon.me || {
60+ echo "Website is not yet accessible, waiting additional 30 seconds..."
61+ sleep 30
62+ }
63+
64+ - name : Trigger DocSearch Crawling
65+ run : |
66+ echo "Triggering DocSearch crawling for updated website..."
67+ response=$(curl -s -w "%{http_code}" -X POST "https://crawler.algolia.com/api/1/crawlers/DOAQK3DEFT/reindex" \
68+ -H "Authorization: Bearer ${{ secrets.DOCSEARCH_API_KEY }}" \
69+ -H "Content-Type: application/json" \
70+ -d '{"force": true}')
71+
72+ http_code="${response: -3}"
73+ if [ "$http_code" -eq 200 ] || [ "$http_code" -eq 201 ]; then
74+ echo "✅ DocSearch crawling triggered successfully"
75+ else
76+ echo "❌ Failed to trigger DocSearch crawling. HTTP code: $http_code"
77+ echo "Response: ${response%???}"
78+ exit 1
79+ fi
80+
81+ - name : Notify completion
82+ run : echo "🎉 DocSearch crawling has been triggered for the updated website. Search index will be updated shortly."
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments