feat: add CSE (AI ML & CY) Notes (Sem 7) page and link in Hero component #24
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: Trigger Vercel Deployment on #deploy Commit | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| trigger-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 # fetch full history to get all commits | |
| - name: Check commit messages for #deploy | |
| id: check_deploy | |
| run: | | |
| echo "Checking commits for #deploy keyword..." | |
| commits=$(git log --format=%B ${{ github.event.before }}..${{ github.sha }}) | |
| echo "Commit messages in push:" | |
| echo "$commits" | |
| if echo "$commits" | grep -q "#deploy"; then | |
| echo "deploy=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "deploy=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Trigger Vercel Deployment | |
| if: steps.check_deploy.outputs.deploy == 'true' | |
| run: | | |
| echo "Triggering Vercel deployment..." | |
| response=$(curl -s -w "%{http_code}" -X POST "${{ secrets.VERCEL_DEPLOY_HOOK_URL }}" -o response.txt) | |
| body=$(cat response.txt) | |
| echo "Response body:" | |
| echo "$body" | |
| echo "HTTP status code: $response" | |
| if [[ "$response" -lt 200 || "$response" -ge 300 ]]; then | |
| echo "Deployment trigger failed with HTTP status $response" | |
| exit 1 | |
| fi | |
| # Optionally check if response contains expected keys | |
| if ! echo "$body" | grep -q '"job"'; then | |
| echo "Unexpected response body, deployment might not have triggered." | |
| exit 1 | |
| fi | |
| - name: Get commit author | |
| id: commit_author | |
| run: | | |
| AUTHOR="${{ github.event.head_commit.author.name }} <${{ github.event.head_commit.author.email }}" | |
| echo "Commit author from payload: $AUTHOR" | |
| echo "author=$AUTHOR" >> "$GITHUB_OUTPUT" |