@toptal/davinci-skeleton 4.6.0 → 4.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change Log
2
2
 
3
+ ## 4.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1189](https://github.com/toptal/davinci/pull/1189) [`069bd177`](https://github.com/toptal/davinci/commit/069bd17784f850ba3b9483d63284782b18fdf261) Thanks [@dmaklygin](https://github.com/dmaklygin)! - New GH Temploy Deployment workflow in skeleton
8
+
3
9
  ## 4.6.0
4
10
 
5
11
  ### Minor Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toptal/davinci-skeleton",
3
- "version": "4.6.0",
3
+ "version": "4.7.0",
4
4
  "description": "Toptal frontend application created with Davinci CLI",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -0,0 +1,157 @@
1
+ name: Deploy Temploy
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [master]
6
+ issue_comment:
7
+ types: [ created ]
8
+
9
+ concurrency:
10
+ group: temploy-${{ github.head_ref }}
11
+ cancel-in-progress: true
12
+
13
+ env:
14
+ GITHUB_TOKEN: ${{ secrets.TOPTAL_DEVBOT_TOKEN }}
15
+
16
+ jobs:
17
+ build-push-image:
18
+ name: Build & Push image
19
+ if: >
20
+ github.event.pull_request || (
21
+ github.event.issue.pull_request &&
22
+ github.event.comment.body == '@toptal-bot run temploy'
23
+ )
24
+ timeout-minutes: 45
25
+ env:
26
+ GCR_ACCOUNT_KEY: ${{ secrets.GCR_ACCOUNT_KEY }}
27
+ runs-on: ubuntu-latest
28
+ outputs:
29
+ sha: ${{ steps.get-branch.outputs.sha }}
30
+ repository_name: ${{ steps.get-repo.outputs.repository_name }}
31
+ steps:
32
+ - name: Cancel Previous Runs
33
+ uses: styfle/cancel-workflow-action@d1af9509c9794689332b13f11ada1dfd07fc06ce
34
+
35
+ - name: Checkout
36
+ uses: actions/checkout@v2
37
+
38
+ - id: branch
39
+ uses: xt0rted/pull-request-comment-branch@v1.3.0
40
+
41
+ - name: Specify branch
42
+ id: get-branch
43
+ run: |
44
+ echo "::set-output name=branch::${{ steps.branch.outputs.head_ref }}"
45
+ echo "::set-output name=sha::${{ steps.branch.outputs.head_sha }}"
46
+
47
+ - name: Specify repository name
48
+ id: get-repo
49
+ run: echo ::set-output name=repository_name::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//")
50
+
51
+ - name: Checkout davinci
52
+ uses: actions/checkout@v2
53
+ with:
54
+ repository: toptal/davinci
55
+ token: ${{ env.GITHUB_TOKEN }}
56
+ path: davinci
57
+
58
+ - name: Setup node
59
+ uses: actions/setup-node@v2
60
+
61
+ - uses: actions/checkout@v2
62
+ with:
63
+ repository: toptal/davinci-github-actions
64
+ token: ${{ env.GITHUB_TOKEN }}
65
+ path: ./.github/actions/
66
+
67
+ - uses: ./.github/actions/yarn-install
68
+
69
+ - name: Build
70
+ run: yarn build
71
+ env:
72
+ GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
73
+
74
+ - name: Docker meta
75
+ id: meta
76
+ uses: docker/metadata-action@v3
77
+ with:
78
+ images: gcr.io/toptal-hub/${{ steps.get-repo.outputs.repository_name }}-release
79
+ tags: |
80
+ type=raw,value={{branch}}
81
+ type=raw,value={{sha}}
82
+ type=raw,value=${{ steps.get-branch.outputs.sha }}
83
+ flavor: latest=false
84
+
85
+ - name: Login to GCloud Registry
86
+ uses: docker/login-action@v1
87
+ with:
88
+ registry: gcr.io
89
+ username: _json_key
90
+ password: ${{ env.GCR_ACCOUNT_KEY }}
91
+
92
+ - name: Set up Docker Buildx
93
+ id: buildx
94
+ uses: docker/setup-buildx-action@v1
95
+
96
+ - name: Build and push image
97
+ uses: docker/build-push-action@v2
98
+ with:
99
+ tags: ${{ steps.meta.outputs.tags }}
100
+ push: true
101
+ context: .
102
+ file: ./davinci/packages/ci/src/configs/docker/Dockerfile.gha-deploy
103
+ build-args: |
104
+ ENV_RUNTIME_ENTRYPOINT=./davinci/packages/ci/src/configs/docker/env-runtime.entrypoint.sh
105
+ DIST_FOLDER=./dist
106
+ NGINX_CONFIG=./davinci/packages/davinci/docker/nginx-vhost.conf
107
+ VERSION=${{ steps.get-branch.outputs.sha }}
108
+
109
+ deploy-temploy:
110
+ name: Deploy Temploy
111
+ timeout-minutes: 45
112
+ runs-on: ubuntu-latest
113
+ needs: [build-push-image]
114
+ env:
115
+ JENKINS_USER: toptal-jenkins
116
+ JENKINS_BUILD_TOKEN: ${{ secrets.TOPTAL_JENKINS_BUILD_TOKEN }}
117
+ REPOSITORY_NAME: ${{ needs.build-push-image.outputs.repository_name }}
118
+ RELEASE: ${{ needs.build-push-image.outputs.repository_name }}-pr-${{ github.event.number || github.event.issue.number }}
119
+ steps:
120
+ - uses: actions/checkout@v2
121
+
122
+ - uses: actions/checkout@v2
123
+ with:
124
+ repository: toptal/davinci-github-actions
125
+ token: ${{ env.GITHUB_TOKEN }}
126
+ path: ./.github/actions/
127
+
128
+ - uses: ./.github/actions/extract-env-variables
129
+ id: env-variables
130
+ with:
131
+ github_token: ${{ env.GITHUB_TOKEN }}
132
+ filename: .env.temploy
133
+
134
+ - name: Trigger temploy job
135
+ uses: toptal/jenkins-job-trigger-action@1.0.0
136
+ with:
137
+ jenkins_url: https://jenkins-build.toptal.net/
138
+ jenkins_user: ${{ env.JENKINS_USER }}
139
+ jenkins_token: ${{ env.JENKINS_BUILD_TOKEN }}
140
+ job_name: '${{ env.REPOSITORY_NAME }}/job/${{ env.REPOSITORY_NAME }}-temploy-helm-run'
141
+ job_params: |
142
+ {
143
+ "REPOSITORY_NAME": "${{ env.REPOSITORY_NAME }}",
144
+ "TAG": "${{ needs.build-push-image.outputs.sha }}",
145
+ "ENV": "${{ steps.env-variables.outputs.variables }}",
146
+ "RELEASE": "${{ env.RELEASE }}"
147
+ }
148
+ job_timeout: '1200'
149
+
150
+ - name: Post temploy link
151
+ uses: actions/github-script@v3.0.0
152
+ with:
153
+ github-token: ${{ env.GITHUB_TOKEN }}
154
+ script: |
155
+ const { issue: { number: issue_number }, repo: { owner, repo } } = context
156
+ const body = 'Temploy was scheduled, it will become available in a few minutes and available at https://${{ env.RELEASE }}.toptal.rocks'
157
+ github.issues.createComment({ issue_number, owner, repo, body })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toptal/davinci-skeleton",
3
- "version": "4.6.0",
3
+ "version": "4.7.0",
4
4
  "description": "Toptal frontend application created with Davinci CLI",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toptal/davinci-skeleton",
3
- "version": "4.6.0",
3
+ "version": "4.7.0",
4
4
  "description": "Toptal frontend application created with Davinci CLI",
5
5
  "publishConfig": {
6
6
  "access": "public"