-
Notifications
You must be signed in to change notification settings - Fork 6
38 lines (36 loc) · 1.69 KB
/
next.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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