-
Notifications
You must be signed in to change notification settings - Fork 22
68 lines (57 loc) · 2.14 KB
/
deployment.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
57
58
59
60
61
62
63
64
65
66
67
68
name: 'Deployment (Stage)'
on:
push:
branches:
- 'stage'
# workflow_dispatch:
jobs:
Docusaurus:
name: 'Deployment'
runs-on: ubuntu-latest
environment: stage
steps:
- uses: actions/checkout@v2
- name: echo env vars
run: echo ${{ secrets.PROD_WEBSITE_URL }}
- name: Find and Replace
uses: jacobtomlinson/[email protected]
with:
find: ${{ secrets.PROD_WEBSITE_URL }}
replace: ${{ secrets.STAGE_WEBSITE_URL }}
- uses: actions/checkout@v2
- name: Find and Replace
uses: jacobtomlinson/[email protected]
with:
find: "indexName: '${{ secrets.PROD_INDEX }}',"
replace: "indexName: '${{ secrets.STAGE_INDEX }}',"
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_DOCS_STAGING }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_DOCS_STAGING }}
aws-region: us-east-1
- name: 'Create env file'
run: |
touch .env
echo "HOST=${{ secrets.TYPESENSE_HOST }}" >> .env
echo "API=${{ secrets.PUBLIC_APY_TYPESENSE }}" >> .env
- name: Use Node.js 20.10.x
uses: actions/setup-node@v3
with:
node-version: 20.10.x
- run: npm -v && node -v
- run: npm install --legacy-peer-deps && npm run build
env:
CI: false
- name: Copy files to the test website with the AWS CLI
run: |
cp -R assets/ build/
cd build/
aws s3 sync . s3://lambdatest-stage-docs/support/
sleep 90;
- name: Cloudflare Invalidation
run: |
curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE_ID }}/purge_cache" -H "X-Auth-Email: ${{ secrets.CF_ACCOUNT }}" -H "X-Auth-Key: ${{ secrets.CF_API_SECRET }}" -H "Content-Type: application/json" --data '{"hosts":["${{ secrets.STAGE_WEBSITE_URL }}"] }'
- name: Sleep Invalidation
run: |
sleep 10;