-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (74 loc) · 2.5 KB
/
deploy_production.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
name: Деплой блога на прод
on:
push:
branches:
- master
concurrency: production_environment
jobs:
deploy:
name: Сборка прода
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
deployments: write
steps:
- name: Download CSSSR actions
uses: actions/checkout@v2
with:
repository: CSSSR/actions
ssh-key: ${{ secrets.DOWNLOAD_ACTIONS_SSH_KEY }}
path: actions
- uses: actions/checkout@v2
with:
path: new_blog_prod
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: 'https://npm.pkg.github.com'
scope: '@csssr'
- name: Install dependencies
working-directory: new_blog_prod
run: yarn install --frozen-lockfile
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_GITHUB_REGISTRY_TOKEN }}
- name: Build prod
working-directory: new_blog_prod
run: yarn build
env:
IS_PRODUCTION: 'TRUE'
BLOG_HOST: https://blog.csssr.com
COM_HOST: https://csssr.com
- name: Import secrets
id: secrets
uses: hashicorp/[email protected]
with:
url: https://vault.csssr.com:8200
jwtGithubAudience: ${{secrets.VAULT_JWT_KEY}}
role: s3-cdn-upload
method: jwt
exportEnv: false
secrets: |
aws/sts/s3-cdn-upload access_key | AWS_ACCESS_KEY_ID ;
aws/sts/s3-cdn-upload secret_key | AWS_SECRET_ACCESS_KEY ;
aws/sts/s3-cdn-upload security_token | AWS_SESSION_TOKEN ;
- name: Деплой на продакшен
uses: ./actions/deploy-static-site/v1beta1
with:
auth: 'aws:${{steps.secrets.outputs.AWS_ACCESS_KEY_ID}}:${{steps.secrets.outputs.AWS_SECRET_ACCESS_KEY}}:${{steps.secrets.outputs.AWS_SESSION_TOKEN}}'
token: ${{ secrets.GITHUB_TOKEN }}
site-type: mpa
project-id: csssr-new-blog
files: ./new_blog_prod/out
no-previous-files: 'true'
not-found-page: 404/index.html
host: blog.csssr.com
environment: production
values: |
cache: etag-only
reduceHttpRedirects: enabled
ingress:
annotations:
nginx.ingress.kubernetes.io/server-snippet: |
rewrite ^/$ https://$http_host/en redirect;