Skip to content

Commit 277f622

Browse files
committed
Update deploy configuration
1 parent 593a0df commit 277f622

File tree

4 files changed

+60
-55
lines changed

4 files changed

+60
-55
lines changed

.github/kuberta.yaml

+26-4
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,44 @@ releases:
1515
- workflow: build-storybook.yaml
1616
values:
1717
buildID: build-{{ .Build.RunID }}
18-
csssr-new-blog:
19-
name: csssr-blog
18+
csssr-blog-testing:
19+
name: csssr-blog-production
2020
cluster: gke-csssr-testing
2121
autodeploy-on: default
2222
chart: oci://quay.csssr.cloud/charts/static-site@~1.1.0
2323
slack:
2424
- CKF42GD36 # #csssr_builds
2525
static-params:
2626
projectID: csssr-new-blog
27-
tlsSecret: csssr-new-blog-tls
27+
tlsSecret: csssr-blog-testing-tls
2828
notFoundPagePath: 404/index.html
2929
ingress:
3030
annotations:
3131
nginx.ingress.kubernetes.io/server-snippet: |
3232
rewrite ^/$ https://$http_host/en redirect;
3333
builds:
34-
- workflow: deploy_testing.yml
34+
- workflow: build-testing.yaml
35+
values:
36+
buildID: build-{{ .Build.RunID }}
37+
csssr-blog-production:
38+
name: csssr-blog-production
39+
cluster: gke-csssr-production
40+
base: csssr-blog-testing
41+
autodeploy-on:
42+
push:
43+
- master
44+
static-params:
45+
projectID: csssr-new-blog
46+
host: blog.csssr.com
47+
environment: production
48+
notFoundPagePath: 404/index.html
49+
cache: etag-only
50+
reduceHttpRedirects: enabled
51+
ingress:
52+
annotations:
53+
nginx.ingress.kubernetes.io/server-snippet: |
54+
rewrite ^/$ https://$http_host/en redirect;
55+
builds:
56+
- workflow: build-production.yaml
3557
values:
3658
buildID: build-{{ .Build.RunID }}
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,45 @@
1-
name: Деплой блога на прод
1+
name: Build static production
22
on:
3-
push:
4-
branches:
5-
- master
6-
concurrency: production_environment
3+
workflow_dispatch:
4+
inputs:
5+
kuberta_system:
76

87
jobs:
98
deploy:
10-
name: Сборка прода
9+
name: Build production
1110
runs-on: ubuntu-latest
1211
permissions:
1312
contents: read
1413
id-token: write
15-
deployments: write
1614

1715
steps:
16+
- uses: docker://quay.csssr.cloud/csssr/kuberta-init-workflow:v1
17+
1818
- name: Download CSSSR actions
19-
uses: actions/checkout@v2
19+
uses: actions/checkout@v4
2020
with:
2121
repository: CSSSR/actions
2222
ssh-key: ${{ secrets.DOWNLOAD_ACTIONS_SSH_KEY }}
2323
path: actions
2424

25-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v4
2626
with:
27-
path: new_blog_prod
28-
ref: ${{ github.event.pull_request.head.sha }}
27+
path: blog
2928

30-
- uses: actions/setup-node@v3
29+
- uses: actions/setup-node@v4
3130
with:
3231
node-version: 16
3332
registry-url: 'https://npm.pkg.github.com'
3433
scope: '@csssr'
3534

3635
- name: Install dependencies
37-
working-directory: new_blog_prod
36+
working-directory: blog
3837
run: yarn install --frozen-lockfile
3938
env:
4039
NODE_AUTH_TOKEN: ${{ secrets.NPM_GITHUB_REGISTRY_TOKEN }}
4140

42-
- name: Build prod
43-
working-directory: new_blog_prod
41+
- name: Build production
42+
working-directory: blog
4443
run: yarn build
4544
env:
4645
IS_PRODUCTION: 'TRUE'
@@ -49,7 +48,7 @@ jobs:
4948

5049
- name: Import secrets
5150
id: secrets
52-
uses: hashicorp/vault-action@v2.4.0
51+
uses: hashicorp/vault-action@v2
5352
with:
5453
url: https://vault.csssr.com:8200
5554
jwtGithubAudience: ${{secrets.VAULT_JWT_KEY}}
@@ -61,22 +60,8 @@ jobs:
6160
aws/sts/s3-cdn-upload secret_key | AWS_SECRET_ACCESS_KEY ;
6261
aws/sts/s3-cdn-upload security_token | AWS_SESSION_TOKEN ;
6362
64-
- name: Деплой на продакшен
65-
uses: ./actions/deploy-static-site/v1beta1
63+
- uses: ./actions/upload-static/v1beta1
6664
with:
67-
auth: 'aws:${{steps.secrets.outputs.AWS_ACCESS_KEY_ID}}:${{steps.secrets.outputs.AWS_SECRET_ACCESS_KEY}}:${{steps.secrets.outputs.AWS_SESSION_TOKEN}}'
68-
token: ${{ secrets.GITHUB_TOKEN }}
69-
site-type: mpa
7065
project-id: csssr-new-blog
71-
files: ./new_blog_prod/out
72-
no-previous-files: 'true'
73-
not-found-page: 404/index.html
74-
host: blog.csssr.com
75-
environment: production
76-
values: |
77-
cache: etag-only
78-
reduceHttpRedirects: enabled
79-
ingress:
80-
annotations:
81-
nginx.ingress.kubernetes.io/server-snippet: |
82-
rewrite ^/$ https://$http_host/en redirect;
66+
files: ./blog/out
67+
auth: 'aws:${{steps.secrets.outputs.AWS_ACCESS_KEY_ID}}:${{steps.secrets.outputs.AWS_SECRET_ACCESS_KEY}}:${{steps.secrets.outputs.AWS_SESSION_TOKEN}}'

.github/workflows/build-storybook.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: Storybook
1+
name: Build storybook
22
on:
33
workflow_dispatch:
44
inputs:
55
kuberta_system:
66

77
jobs:
88
build:
9-
name: Build Storybook
9+
name: Build storybook
1010
runs-on: ubuntu-latest
1111
permissions:
1212
contents: read
@@ -19,17 +19,17 @@ jobs:
1919
id: gh
2020

2121
- name: Download CSSSR actions
22-
uses: actions/checkout@v2
22+
uses: actions/checkout@v4
2323
with:
2424
repository: CSSSR/actions
2525
ssh-key: ${{ secrets.DOWNLOAD_ACTIONS_SSH_KEY }}
2626
path: actions
2727

28-
- uses: actions/checkout@v2
28+
- uses: actions/checkout@v4
2929
with:
3030
path: blog
3131

32-
- uses: actions/setup-node@v1
32+
- uses: actions/setup-node@v4
3333
with:
3434
node-version: '14.x'
3535

@@ -43,7 +43,7 @@ jobs:
4343

4444
- name: Import secrets
4545
id: secrets
46-
uses: hashicorp/vault-action@v2.4.0
46+
uses: hashicorp/vault-action@v2
4747
with:
4848
url: https://vault.csssr.com:8200
4949
jwtGithubAudience: ${{secrets.VAULT_JWT_KEY}}
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: Деплой блога на тестинг
1+
name: Build static testing
22
on:
33
workflow_dispatch:
44
inputs:
55
kuberta_system:
66

77
jobs:
88
deploy:
9-
name: Сборка тестинга
9+
name: Build testing
1010
runs-on: ubuntu-latest
1111
permissions:
1212
contents: read
@@ -16,25 +16,24 @@ jobs:
1616
- uses: docker://quay.csssr.cloud/csssr/kuberta-init-workflow:v1
1717

1818
- name: Download CSSSR actions
19-
uses: actions/checkout@v2
19+
uses: actions/checkout@v4
2020
with:
2121
repository: CSSSR/actions
2222
ssh-key: ${{ secrets.DOWNLOAD_ACTIONS_SSH_KEY }}
2323
path: actions
2424

25-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v4
2626
with:
27-
path: new_blog
28-
ref: ${{ github.event.pull_request.head.sha }}
27+
path: blog
2928

30-
- uses: actions/setup-node@v3
29+
- uses: actions/setup-node@v4
3130
with:
3231
node-version: 16
3332
registry-url: 'https://npm.pkg.github.com'
3433
scope: '@csssr'
3534

3635
- name: Install dependencies
37-
working-directory: new_blog
36+
working-directory: blog
3837
run: yarn install --frozen-lockfile
3938
env:
4039
NODE_AUTH_TOKEN: ${{ secrets.NPM_GITHUB_REGISTRY_TOKEN }}
@@ -43,15 +42,15 @@ jobs:
4342
id: gh
4443

4544
- name: Build testing
46-
working-directory: new_blog
45+
working-directory: blog
4746
run: yarn build
4847
env:
4948
BLOG_HOST: https://${{ steps.gh.outputs.releaseID }}.csssr-new-blog.csssr.cloud
5049
COM_HOST: https://master.com.csssr.cloud
5150

5251
- name: Import secrets
5352
id: secrets
54-
uses: hashicorp/vault-action@v2.4.0
53+
uses: hashicorp/vault-action@v2
5554
with:
5655
url: https://vault.csssr.com:8200
5756
jwtGithubAudience: ${{secrets.VAULT_JWT_KEY}}
@@ -66,6 +65,5 @@ jobs:
6665
- uses: ./actions/upload-static/v1beta1
6766
with:
6867
project-id: csssr-new-blog
69-
files: ./new_blog/out
70-
no-previous-files: 'true'
68+
files: ./blog/out
7169
auth: 'aws:${{steps.secrets.outputs.AWS_ACCESS_KEY_ID}}:${{steps.secrets.outputs.AWS_SECRET_ACCESS_KEY}}:${{steps.secrets.outputs.AWS_SESSION_TOKEN}}'

0 commit comments

Comments
 (0)