-
Notifications
You must be signed in to change notification settings - Fork 2.2k
56 lines (50 loc) · 1.64 KB
/
deploy.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Deploy ngrok docs
on:
push:
branches:
- main
jobs:
deploy:
name: Deploy ngrok docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 18
cache: "pnpm"
- name: "Create env file"
run: |
echo DEPLOY_ENV=prod > .env
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build website
run: pnpm run build
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: Deploy
run: |
aws s3 sync ./build s3://docs-s3.dev-ngrok.com/docs --acl public-read
aws s3 sync ./build s3://docs-s3.stage-ngrok.com/docs --acl public-read
aws s3 sync ./build s3://docs-s3.ngrok.com/docs --acl public-read
search-index-prod:
needs: deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run algolia/docsearch-scraper
run: |
docker pull algolia/docsearch-scraper
docker run \
-e ALGOLIA_APP_ID=${{ secrets.DEV_ALGOLIA_APPLICATION_ID }} \
-e API_KEY=${{ secrets.DEV_ALGOLIA_API_KEY }} \
-e INDEX_NAME_TMP="prod_ngrok_tmp_$(date +%s)" \
-e "CONFIG=$(cat ./algolia_prod.config.json | jq -r tostring)" \
algolia/docsearch-scraper