Feat: Adds Orama-powered search bar #484
Workflow file for this run
This file contains 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: Build | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: {} | ||
schedule: | ||
- cron: "1 0 * * FRI" # every FRI at 00:01 | ||
workflow_dispatch: {} # manual release | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Begin CI... | ||
uses: actions/checkout@v4 | ||
- name: Use Node 18 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.x | ||
- name: Use cached node_modules | ||
uses: actions/cache@v4 | ||
with: | ||
path: node_modules | ||
key: nodeModules-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
nodeModules- | ||
- name: Set Branch Name | ||
id: branch_name | ||
uses: nelonoel/branch-name@v1.0.1 | ||
- name: Setup Deployment Condition | ||
id: deploy_setup | ||
run: | | ||
if [ "${{ env.BRANCH_NAME }}" == "main" ]; then | ||
echo "DEPLOY_TO_PROD=true" >> $GITHUB_ENV | ||
else | ||
echo "DEPLOY_TO_PROD=false" >> $GITHUB_ENV | ||
echo "DEPLOY_ALIAS=${{ env.BRANCH_NAME }}" >> $GITHUB_ENV | ||
fi | ||
- name: Publish site to Netlify | ||
uses: jsmrcaga/action-netlify-deploy@v2.1.0 | ||
with: | ||
NETLIFY_DEPLOY_TO_PROD: ${{ env.DEPLOY_TO_PROD }} | ||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_TOKEN }} | ||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | ||
NETLIFY_DEPLOY_MESSAGE: "Deployment from GitHub Actions ${{ steps.vars.outputs.sha_short }} (${{ steps.vars.outputs.branch }})" | ||
deploy_alias: ${{ env.DEPLOY_ALIAS }} | ||
build_directory: dist | ||
- name: Publish new Orama Index | ||
run: | | ||
Check failure on line 58 in .github/workflows/deploy.yml GitHub Actions / BuildInvalid workflow file
|
||
curl https://api.oramasearch.com/api/v1/indexes/queue-deployment \ | ||
-H 'content-type: application/json' \ | ||
-d '{"indexId":"juevpr4vk3mdx6g8be3i20t8"}' \ | ||
-H "Authorization: Bearer ${{ORAMA_PRIVATE_API_KEY}}" | ||
# Creates a status check with link to preview | ||
- name: Get Netlify Status / Preview URL | ||
if: ${{ env.DEPLOY_TO_PROD != 'true' }} | ||
uses: Sibz/github-status-action@v1.1.1 | ||
with: | ||
authToken: ${{ secrets.GITHUB_TOKEN }} | ||
context: Netlify preview | ||
state: success | ||
target_url: ${{ env.NETLIFY_PREVIEW_URL }} |