|
1 | | -name: Деплой блога на прод |
| 1 | +name: Build static production |
2 | 2 | on: |
3 | | - push: |
4 | | - branches: |
5 | | - - master |
6 | | -concurrency: production_environment |
| 3 | + workflow_dispatch: |
| 4 | + inputs: |
| 5 | + kuberta_system: |
7 | 6 |
|
8 | 7 | jobs: |
9 | 8 | deploy: |
10 | | - name: Сборка прода |
| 9 | + name: Build production |
11 | 10 | runs-on: ubuntu-latest |
12 | 11 | permissions: |
13 | 12 | contents: read |
14 | 13 | id-token: write |
15 | | - deployments: write |
16 | 14 |
|
17 | 15 | steps: |
| 16 | + - uses: docker://quay.csssr.cloud/csssr/kuberta-init-workflow:v1 |
| 17 | + |
18 | 18 | - name: Download CSSSR actions |
19 | | - uses: actions/checkout@v2 |
| 19 | + uses: actions/checkout@v4 |
20 | 20 | with: |
21 | 21 | repository: CSSSR/actions |
22 | 22 | ssh-key: ${{ secrets.DOWNLOAD_ACTIONS_SSH_KEY }} |
23 | 23 | path: actions |
24 | 24 |
|
25 | | - - uses: actions/checkout@v2 |
| 25 | + - uses: actions/checkout@v4 |
26 | 26 | with: |
27 | | - path: new_blog_prod |
28 | | - ref: ${{ github.event.pull_request.head.sha }} |
| 27 | + path: blog |
29 | 28 |
|
30 | | - - uses: actions/setup-node@v3 |
| 29 | + - uses: actions/setup-node@v4 |
31 | 30 | with: |
32 | 31 | node-version: 16 |
33 | 32 | registry-url: 'https://npm.pkg.github.com' |
34 | 33 | scope: '@csssr' |
35 | 34 |
|
36 | 35 | - name: Install dependencies |
37 | | - working-directory: new_blog_prod |
| 36 | + working-directory: blog |
38 | 37 | run: yarn install --frozen-lockfile |
39 | 38 | env: |
40 | 39 | NODE_AUTH_TOKEN: ${{ secrets.NPM_GITHUB_REGISTRY_TOKEN }} |
41 | 40 |
|
42 | | - - name: Build prod |
43 | | - working-directory: new_blog_prod |
| 41 | + - name: Build production |
| 42 | + working-directory: blog |
44 | 43 | run: yarn build |
45 | 44 | env: |
46 | 45 | IS_PRODUCTION: 'TRUE' |
|
49 | 48 |
|
50 | 49 | - name: Import secrets |
51 | 50 | id: secrets |
52 | | - uses: hashicorp/vault-action@v2.4.0 |
| 51 | + uses: hashicorp/vault-action@v2 |
53 | 52 | with: |
54 | 53 | url: https://vault.csssr.com:8200 |
55 | 54 | jwtGithubAudience: ${{secrets.VAULT_JWT_KEY}} |
|
61 | 60 | aws/sts/s3-cdn-upload secret_key | AWS_SECRET_ACCESS_KEY ; |
62 | 61 | aws/sts/s3-cdn-upload security_token | AWS_SESSION_TOKEN ; |
63 | 62 |
|
64 | | - - name: Деплой на продакшен |
65 | | - uses: ./actions/deploy-static-site/v1beta1 |
| 63 | + - uses: ./actions/upload-static/v1beta1 |
66 | 64 | 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 |
70 | 65 | 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}}' |
0 commit comments