Merge pull request #32 from flexn-io/main #5
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: Vercel Prod Deployment | |
on: | |
push: | |
branches: | |
- release | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
environment: vercel-deployments | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Set scraper config environment variable | |
id: scraper_config | |
run: | | |
export SCRAPER_CONFIG=$(cat ./config.prod.json | jq -r tostring) | |
echo "scraper_config=${SCRAPER_CONFIG}" >> $GITHUB_OUTPUT | |
- name: Install Vercel CLI | |
run: npm install --global vercel@latest | |
- run: rm -rf .vercel | |
- name: Pull Vercel Environment Information | |
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Build Project Artifacts | |
run: BASE_URL=https://renative.org ALGOLIA_INDEX=renative_docsearch vercel build | |
- name: Deploy Project Artifacts to Vercel | |
run: | | |
url="$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})" | |
vercel alias --token=${{ secrets.VERCEL_TOKEN }} --scope=${{ secrets.VERCEL_ORG_ID }} set "$url" renative.org | |
- name: Update Algolia index | |
uses: addnab/docker-run-action@v3 | |
with: | |
image: algolia/docsearch-scraper | |
run: | | |
CONFIG='${{ steps.scraper_config.outputs.scraper_config }}' APPLICATION_ID=${{ secrets.ALGOLIA_APPLICATION_ID }} API_KEY=${{ secrets.ALGOLIA_API_KEY }} pipenv run python -m src.index |