-
Notifications
You must be signed in to change notification settings - Fork 184
144 lines (122 loc) · 4.1 KB
/
deploy_docs_on_branch_push.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: 'Deploy next version docs'
on:
push:
branches:
- master
paths-ignore:
- '.husky/**'
- '.codesandbox/**'
- '.github/**'
- '!.github/actions/**'
- '.github/actions/**/*.yml'
- '**/*.md'
- '!packages/vkui/src/**/*.md'
- '!styleguide/pages/**/*.md'
- '**/__image_snapshots__/*.png'
env:
AWS_S3_URL: https://${{ vars.AWS_BUCKET }}.${{ vars.AWS_ENDPOINT }}
concurrency:
group: deploy-docs-${{ github.ref_name }}
cancel-in-progress: true
jobs:
changed_files:
runs-on: ubuntu-latest
name: Detect what files changed
outputs:
docs_styleguide: ${{ steps.changes.outputs.docs_styleguide }}
docs_storybook: ${{ steps.changes.outputs.docs_storybook }}
docs_beta: ${{ steps.changes.outputs.docs_beta }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Find changes
uses: dorny/paths-filter@v3
id: changes
with:
token: ${{ secrets.GITHUB_TOKEN }}
filters: .github/file-filters.yml
build_and_deploy_styleguide:
if: ${{ !cancelled() && needs.changed_files.outputs.docs_styleguide == 'true' }}
runs-on: ubuntu-latest
name: Deploy docs (styleguide)
needs: changed_files
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Node setup
uses: ./.github/actions/node-setup
- name: Build
run: yarn docs:styleguide:build
- name: Upload to S3
id: deploy
uses: VKCOM/gh-actions/VKUI/s3@main
with:
awsAccessKeyId: ${{ secrets.AWS_ACCESS_KEY_ID }}
awsSecretAccessKey: ${{ secrets.AWS_SECRET_KEY }}
awsBucket: ${{ vars.AWS_BUCKET }}
awsEndpoint: https://${{ vars.AWS_ENDPOINT }}
command: upload
commandUploadSrc: styleguide/dist
commandUploadDist: next/styleguide
- name: Create doc url
if: ${{ steps.deploy.outcome == 'success' }}
id: url
run: echo "${{ env.AWS_S3_URL }}/next/styleguide/index.html"
build_and_deploy_storybook:
if: ${{ !cancelled() && needs.changed_files.outputs.docs_storybook == 'true' }}
runs-on: ubuntu-latest
name: Deploy docs (storybook)
needs: changed_files
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Node setup
uses: ./.github/actions/node-setup
- name: Build
run: yarn docs:storybook:build
- name: Upload to S3
id: deploy
uses: VKCOM/gh-actions/VKUI/s3@main
with:
awsAccessKeyId: ${{ secrets.AWS_ACCESS_KEY_ID }}
awsSecretAccessKey: ${{ secrets.AWS_SECRET_KEY }}
awsBucket: ${{ vars.AWS_BUCKET }}
awsEndpoint: https://${{ vars.AWS_ENDPOINT }}
command: upload
commandUploadSrc: packages/vkui/storybook-static
commandUploadDist: next/storybook
- name: Create doc url
if: ${{ steps.deploy.outcome == 'success' }}
id: url
run: echo "${{ env.AWS_S3_URL }}/next/storybook/index.html"
build_and_deploy_docs_beta:
if: ${{ !cancelled() && needs.changed_files.outputs.docs_beta == 'true' }}
runs-on: ubuntu-latest
name: Deploy docs (beta)
needs: changed_files
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Node setup
uses: ./.github/actions/node-setup
- name: Build VKUI
run: yarn build:vkui
- name: Build
run: yarn docs:beta:build
env:
VKUI_DOCS_BASE_PATH: /next/docs-beta
- name: Upload to S3
id: deploy
uses: VKCOM/gh-actions/VKUI/s3@main
with:
awsAccessKeyId: ${{ secrets.AWS_ACCESS_KEY_ID }}
awsSecretAccessKey: ${{ secrets.AWS_SECRET_KEY }}
awsBucket: ${{ vars.AWS_BUCKET }}
awsEndpoint: https://${{ vars.AWS_ENDPOINT }}
command: upload
commandUploadSrc: website/out
commandUploadDist: next/docs-beta
- name: Create doc url
if: ${{ steps.deploy.outcome == 'success' }}
id: url
run: echo "${{ env.AWS_S3_URL }}/next/docs-beta/overview/about.html"