Merge pull request #21 from flexn-io/fix/theme-not-persisting #57
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 Next Deployment | |
on: | |
push: | |
branches: | |
- main | |
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.next.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 --git-branch=release/1.0 --environment=preview --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Build Project Artifacts | |
run: BASE_URL=https://next.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" next.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 |