Add Swift Layout Content #159
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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." |