@lomray/vite-ssr-boost 1.0.0-beta.13 → 1.0.0-beta.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lomray/vite-ssr-boost",
3
- "version": "1.0.0-beta.13",
3
+ "version": "1.0.0-beta.14",
4
4
  "description": "Vite plugin for create awesome SSR or SPA applications on React.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -0,0 +1,73 @@
1
+ name: SSR BOOST Build
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ node-version:
7
+ required: false
8
+ type: string
9
+ default: 18.13.0
10
+ app-build-args:
11
+ required: false
12
+ type: string
13
+ docker-file:
14
+ required: false
15
+ type: string
16
+ default: node_modules/@lomray/vite-ssr-boost/workflow/Dockerfile
17
+ secrets:
18
+ github-token:
19
+ required: false
20
+
21
+ jobs:
22
+ build:
23
+ runs-on: ubuntu-latest
24
+ concurrency:
25
+ group: ${{ github.ref }}-build
26
+ cancel-in-progress: true
27
+
28
+ steps:
29
+ - uses: actions/checkout@v3
30
+
31
+ - run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.github-token }}" > ~/.npmrc
32
+
33
+ - uses: actions/setup-node@v3
34
+ with:
35
+ node-version: ${{ inputs.config-path }}
36
+ cache: 'npm'
37
+
38
+ - name: Install dependencies
39
+ run: npm ci
40
+
41
+ - name: Run eslint
42
+ run: npm run lint:check
43
+
44
+ - name: Typescript check
45
+ run: npm run ts:check
46
+
47
+ - name: Stylelint check
48
+ run: npm run style:check
49
+
50
+ - name: Build application
51
+ run: |
52
+ npm pkg delete scripts.prepare
53
+ npm run build -- ${{ inputs.app-build-args }}
54
+
55
+ - name: Prepare docker file
56
+ if: ${{ inputs.docker-file != '' }}
57
+ shell: bash
58
+ id: prepare-docker
59
+ run: |
60
+ # ignore errors
61
+ set +e
62
+ cp ${{ inputs.docker-file }} Dockerfile
63
+ echo "docker-file-name=Dockerfile" >> $GITHUB_OUTPUT
64
+
65
+ - name: Archive build
66
+ uses: actions/upload-artifact@v3
67
+ with:
68
+ name: build-artifact
69
+ path: |
70
+ build
71
+ package.json
72
+ package-lock.json
73
+ ${{ steps.prepare-docker.outputs.docker-file-name }}
@@ -0,0 +1,60 @@
1
+ name: SSR BOOST Deploy AWS
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ image:
7
+ required: true
8
+ type: string
9
+ service:
10
+ required: true
11
+ type: string
12
+ cluster:
13
+ required: true
14
+ type: string
15
+ task-container-name:
16
+ required: true
17
+ type: string
18
+ task-definition:
19
+ required: false
20
+ type: string
21
+ default: .github/task-definition.json
22
+ secrets:
23
+ AWS_ACCESS_KEY_ID:
24
+ required: true
25
+ AWS_SECRET_ACCESS_KEY:
26
+ required: true
27
+ AWS_REGION:
28
+ required: true
29
+
30
+ jobs:
31
+ deploy-aws:
32
+ runs-on: ubuntu-latest
33
+ concurrency:
34
+ group: ${{ github.ref }}-deploy-aws
35
+ cancel-in-progress: true
36
+
37
+ steps:
38
+ - uses: actions/checkout@v3
39
+
40
+ - name: Configure AWS credentials
41
+ uses: aws-actions/configure-aws-credentials@v2
42
+ with:
43
+ aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
44
+ aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
45
+ aws-region: ${{ secrets.AWS_REGION }}
46
+
47
+ - name: Update AWS ECS Task Definition
48
+ id: task-def
49
+ uses: aws-actions/amazon-ecs-render-task-definition@v1
50
+ with:
51
+ task-definition: ${{ inputs.task-definition }}
52
+ container-name: ${{ inputs.task-container-name }}
53
+ image: ${{ inputs.image }}
54
+
55
+ - name: Deploy AWS ECS Task Definition
56
+ uses: aws-actions/amazon-ecs-deploy-task-definition@v1
57
+ with:
58
+ task-definition: ${{ steps.task-def.outputs.task-definition }}
59
+ service: ${{ inputs.service }}
60
+ cluster: ${{ inputs.cluster }}
@@ -0,0 +1,71 @@
1
+ name: SSR BOOST Docker build
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ registry:
7
+ required: true
8
+ type: string
9
+ image-name:
10
+ required: true
11
+ type: string
12
+ version:
13
+ required: true
14
+ type: string
15
+ app-build-path:
16
+ required: true
17
+ type: string
18
+ secrets:
19
+ github-token:
20
+ required: true
21
+ outputs:
22
+ image-tag:
23
+ description: "Docker image with new tag version"
24
+ value: ${{ jobs.docker-build.outputs.image-tag }}
25
+
26
+ jobs:
27
+ docker-build:
28
+ runs-on: ubuntu-latest
29
+ concurrency:
30
+ group: ${{ github.ref }}-build-docker
31
+ cancel-in-progress: true
32
+ outputs:
33
+ # get docker image tag with version
34
+ image-tag: ${{ fromJSON(steps.meta.outputs.json).tags[0] }}
35
+
36
+ steps:
37
+ - uses: actions/download-artifact@v3
38
+ with:
39
+ name: build-artifact
40
+
41
+ - name: Setup Docker buildx
42
+ uses: docker/setup-buildx-action@v2
43
+
44
+ - name: Log into registry
45
+ uses: docker/login-action@v2
46
+ with:
47
+ registry: ${{ inputs.registry }}
48
+ username: ${{ github.actor }}
49
+ password: ${{ secrets.github-token }}
50
+
51
+ - name: Extract Docker metadata
52
+ id: meta
53
+ uses: docker/metadata-action@v4
54
+ with:
55
+ images: ${{ inputs.registry }}/${{ inputs.image-name }}
56
+ tags: |
57
+ type=raw,prefix={{branch}}-,value=${{ inputs.version }}
58
+ type=raw,prefix=latest-,value={{branch}}
59
+
60
+ - name: Build and push Docker image
61
+ id: build-and-push
62
+ uses: docker/build-push-action@v4
63
+ with:
64
+ context: .
65
+ push: true
66
+ tags: ${{ steps.meta.outputs.tags }}
67
+ labels: ${{ steps.meta.outputs.labels }}
68
+ cache-from: type=gha
69
+ cache-to: type=gha,mode=max
70
+ build-args: |
71
+ BUILD_PATH=${{ inputs.app-build-path }}
@@ -0,0 +1,48 @@
1
+ name: SSR BOOST Release
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ has-release-asset:
7
+ required: false
8
+ type: boolean
9
+ default: false
10
+ secrets:
11
+ github-token:
12
+ required: true
13
+ outputs:
14
+ version:
15
+ description: "New package version"
16
+ value: ${{ jobs.release.outputs.version }}
17
+
18
+ jobs:
19
+ release:
20
+ runs-on: ubuntu-latest
21
+ concurrency:
22
+ group: ${{ github.ref }}-release
23
+ cancel-in-progress: true
24
+ outputs:
25
+ version: ${{ steps.package-version.outputs.version }}
26
+
27
+ steps:
28
+ - uses: actions/checkout@v3
29
+
30
+ - uses: actions/download-artifact@v3
31
+ with:
32
+ name: build-artifact
33
+
34
+ - name: Create release asset
35
+ if: ${{ inputs.has-release-asset }}
36
+ run: zip -r build.zip build package.json package-lock.json README.md
37
+
38
+ - name: Install dependencies
39
+ run: npm ci
40
+
41
+ - name: Release
42
+ env:
43
+ GITHUB_TOKEN: ${{ secrets.github-token }}
44
+ run: npx semantic-release
45
+
46
+ - name: Get version
47
+ id: package-version
48
+ run: npx @lomray/microservices-cli package-version