-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (66 loc) · 2.18 KB
/
deploy.yml
File metadata and controls
81 lines (66 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Deploy
on:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: deploy-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-deploy:
runs-on: macos-15
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set Xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "26.0"
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- name: Install Tailwind CSS dependencies
run: npm install
- name: Build Tailwind CSS
run: npx tailwindcss -i ./Sources/Website/Styles/global.css -o ./dist/global.css --minify
- name: Build and generate website
run: swift run Website
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
publish_branch: gh-pages
cname: jihoon.me
force_orphan: true
docsearch-crawl:
needs: build-and-deploy
runs-on: macos-15
if: github.ref == 'refs/heads/main'
steps:
- name: Wait for deployment
run: sleep 30
- name: Verify website is accessible
run: |
curl -f -s -o /dev/null https://jihoon.me || {
echo "Website is not yet accessible, waiting additional 30 seconds..."
sleep 30
}
- name: Install Algolia CLI via Homebrew
run: |
brew tap algolia/algolia-cli
brew install algolia
- name: Trigger DocSearch Crawler (via Algolia CLI)
env:
ALGOLIA_APPLICATION_ID: DOAQK3DEFT
ALGOLIA_CRAWLER_USER_ID: ${{ secrets.DOCSEARCH_USER_ID }}
ALGOLIA_CRAWLER_API_KEY: ${{ secrets.DOCSEARCH_API_KEY }}
run: |
echo "🚀 Triggering DocSearch crawler..."
algolia crawler reindex 8056d134-dd88-478d-9ebc-decf9fa15518
echo "✅ DocSearch crawler reindex triggered successfully!"
- name: Notify completion
run: echo "🎉 DocSearch crawling has been triggered for the updated website. Search index will be updated shortly."