-
Notifications
You must be signed in to change notification settings - Fork 3
78 lines (66 loc) · 2.27 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Documentation
on:
push:
branches:
- master
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
workflow_dispatch:
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
jobs:
deploy:
name: Deploy kubeblocks.io
runs-on: ubuntu-latest
steps:
- name: Checkout Kubeblocks.io
uses: actions/checkout@v3
- name: Checkout Kubeblocks Docs main
uses: actions/checkout@v3
with:
repository: apecloud/kubeblocks
ref: main
path: ".temp/main"
token: ${{ env.GITHUB_TOKEN }}
- name: Checkout Kubeblocks Docs release-0.7
uses: actions/checkout@v3
with:
repository: apecloud/kubeblocks
ref: release-0.7
path: ".temp/release-0.7"
token: ${{ env.GITHUB_TOKEN }}
- name: Checkout Kubeblocks Docs release-0.8
uses: actions/checkout@v3
with:
repository: apecloud/kubeblocks
ref: release-0.8
path: ".temp/release-0.8"
token: ${{ env.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- name: Reset Docs
run: yarn docs:reset
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Build Docs
run: yarn build
- name: Deploy to aws s3
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: kubeblocks.io
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-west-2 # optional: defaults to us-east-1
SOURCE_DIR: build # optional: defaults to entire repository
- name: Invalidate CloudFront
uses: chetan/invalidate-cloudfront-action@v2
env:
DISTRIBUTION: ${{ secrets.DISTRIBUTION }}
PATHS: "/*"
AWS_REGION: "us-east-1"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}