react-covideo-embed 1.0.61 → 1.0.63
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/.github/DEPLOYMENT_SETUP.md +161 -0
- package/.github/workflows/publish-and-deploy.yml +91 -0
- package/build/app/pages/login/SSOLogin.d.ts +5 -0
- package/build/index.js +3 -3
- package/build/lib/api/sso/useSSOLoginMutation.d.ts +7 -0
- package/build/lib/components/formik/FormikErrorMessage.d.ts +7 -1
- package/build/lib/components/formik/FormikInputField.d.ts +11 -3
- package/build/lib/components/formik/FormikLabel.d.ts +5 -1
- package/build/lib/components/styles/layout.d.ts +26 -0
- package/build/lib/context/AuthorizationContext.d.ts +1 -0
- package/build/lib/hooks/GTM/actions/recording/types.d.ts +2 -2
- package/build/lib/hooks/GTM/actions/video/saveNewVideoInteraction.d.ts +1 -1
- package/build/lib/hooks/GTM/types.d.ts +6 -4
- package/build/lib/hooks/GTM/utils.d.ts +8 -8
- package/package.json +1 -1
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# Automated Deployment Setup Guide
|
|
2
|
+
|
|
3
|
+
This document describes how to configure the automated deployment pipeline between `react-covideo-embed` and `embeddable-ecorder`.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
When a new version of `react-covideo-embed` is published to npm:
|
|
8
|
+
1. The `react-covideo-embed` workflow publishes to npm
|
|
9
|
+
2. It sends a repository dispatch event to `embeddable-ecorder`
|
|
10
|
+
3. The `embeddable-ecorder` workflow deploys all 6 version branches to S3
|
|
11
|
+
4. CloudFront cache is invalidated
|
|
12
|
+
|
|
13
|
+
## Required Secrets
|
|
14
|
+
|
|
15
|
+
### react-covideo-embed Repository
|
|
16
|
+
|
|
17
|
+
Go to: `Settings → Secrets and variables → Actions → New repository secret`
|
|
18
|
+
|
|
19
|
+
| Secret Name | Description | How to Get |
|
|
20
|
+
|-------------|-------------|------------|
|
|
21
|
+
| `ECORDER_DEPLOY_TOKEN` | GitHub PAT to trigger embeddable-ecorder workflow | See "Creating the Deploy Token" below |
|
|
22
|
+
|
|
23
|
+
**Note:** npm publishing uses OIDC trusted publishing (no `NPM_TOKEN` needed). The repository is configured as a trusted publisher on npm.
|
|
24
|
+
|
|
25
|
+
### embeddable-ecorder Repository
|
|
26
|
+
|
|
27
|
+
Go to: `Settings → Secrets and variables → Actions → New repository secret`
|
|
28
|
+
|
|
29
|
+
| Secret Name | Description | How to Get |
|
|
30
|
+
|-------------|-------------|------------|
|
|
31
|
+
| `AWS_ACCESS_KEY_ID` | AWS IAM access key for S3/CloudFront | AWS IAM Console |
|
|
32
|
+
| `AWS_SECRET_ACCESS_KEY` | AWS IAM secret key | AWS IAM Console |
|
|
33
|
+
| `CLOUDFRONT_DISTRIBUTION_ID` | CloudFront distribution ID for code.covideo.com | AWS CloudFront Console |
|
|
34
|
+
|
|
35
|
+
**Note:** The workflow uses the built-in `GITHUB_TOKEN` to commit version bumps back to each branch. If your repository has branch protection rules that block pushes, you may need to either:
|
|
36
|
+
- Allow GitHub Actions to bypass branch protection, OR
|
|
37
|
+
- Create a PAT with write permissions and add it as a secret (e.g., `REPO_PAT`)
|
|
38
|
+
|
|
39
|
+
## Creating the Deploy Token (ECORDER_DEPLOY_TOKEN)
|
|
40
|
+
|
|
41
|
+
1. Go to GitHub → Settings → Developer settings → Personal access tokens → Fine-grained tokens
|
|
42
|
+
2. Click "Generate new token"
|
|
43
|
+
3. Configure:
|
|
44
|
+
- **Token name:** `ecorder-deploy-trigger`
|
|
45
|
+
- **Expiration:** Set appropriate expiration (or no expiration for automation)
|
|
46
|
+
- **Repository access:** Select "Only select repositories" → `covideodevteam/embeddable-ecorder`
|
|
47
|
+
- **Permissions:**
|
|
48
|
+
- Repository permissions → Contents: Read and write
|
|
49
|
+
- Repository permissions → Metadata: Read-only
|
|
50
|
+
4. Generate and copy the token
|
|
51
|
+
5. Add it as `ECORDER_DEPLOY_TOKEN` secret in `react-covideo-embed` repository
|
|
52
|
+
|
|
53
|
+
## AWS IAM Policy
|
|
54
|
+
|
|
55
|
+
The AWS credentials need these permissions:
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"Version": "2012-10-17",
|
|
60
|
+
"Statement": [
|
|
61
|
+
{
|
|
62
|
+
"Effect": "Allow",
|
|
63
|
+
"Action": [
|
|
64
|
+
"s3:PutObject",
|
|
65
|
+
"s3:PutObjectAcl",
|
|
66
|
+
"s3:GetObject",
|
|
67
|
+
"s3:ListBucket"
|
|
68
|
+
],
|
|
69
|
+
"Resource": [
|
|
70
|
+
"arn:aws:s3:::covideo-code-cdn",
|
|
71
|
+
"arn:aws:s3:::covideo-code-cdn/recorder/*"
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"Effect": "Allow",
|
|
76
|
+
"Action": [
|
|
77
|
+
"cloudfront:CreateInvalidation"
|
|
78
|
+
],
|
|
79
|
+
"Resource": "arn:aws:cloudfront::<ACCOUNT_ID>:distribution/<DISTRIBUTION_ID>"
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Deployment Flow
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
┌─────────────────────────────────────────────────────────────────────┐
|
|
89
|
+
│ react-covideo-embed │
|
|
90
|
+
├─────────────────────────────────────────────────────────────────────┤
|
|
91
|
+
│ 1. Push to master with version change │
|
|
92
|
+
│ 2. CI detects version bump in package.json │
|
|
93
|
+
│ 3. npm ci && npm run build │
|
|
94
|
+
│ 4. npm publish (to @latest tag) │
|
|
95
|
+
│ 5. Send repository_dispatch to embeddable-ecorder │
|
|
96
|
+
└─────────────────────────────────────────────────────────────────────┘
|
|
97
|
+
│
|
|
98
|
+
▼
|
|
99
|
+
┌─────────────────────────────────────────────────────────────────────┐
|
|
100
|
+
│ embeddable-ecorder │
|
|
101
|
+
├─────────────────────────────────────────────────────────────────────┤
|
|
102
|
+
│ Receives dispatch event with version number │
|
|
103
|
+
│ │
|
|
104
|
+
│ For EACH version branch (parallel): │
|
|
105
|
+
│ ┌────────────────────────────────────────────────────────────────┐ │
|
|
106
|
+
│ │ • version/elead → s3://covideo-code-cdn/recorder/version-elead │ │
|
|
107
|
+
│ │ • version/dealersocket → s3://covideo-code-cdn/recorder/version-dealersocket │ │
|
|
108
|
+
│ │ • version/sandbox → s3://covideo-code-cdn/recorder/version-sandbox │ │
|
|
109
|
+
│ │ • version/mobile → s3://covideo-code-cdn/recorder/version-mobile │ │
|
|
110
|
+
│ │ • version/cdk → s3://covideo-code-cdn/recorder/version-cdk │ │
|
|
111
|
+
│ │ • version/momentum → s3://covideo-code-cdn/recorder/version-momentum │ │
|
|
112
|
+
│ └────────────────────────────────────────────────────────────────┘ │
|
|
113
|
+
│ │
|
|
114
|
+
│ Each branch: │
|
|
115
|
+
│ 1. Checkout branch │
|
|
116
|
+
│ 2. npm ci │
|
|
117
|
+
│ 3. npm install react-covideo-embed@<version> │
|
|
118
|
+
│ 4. npm run build │
|
|
119
|
+
│ 5. Rename main.*.js → main.js │
|
|
120
|
+
│ 6. Upload to S3 with public-read ACL │
|
|
121
|
+
│ 7. Commit package.json update back to branch │
|
|
122
|
+
│ │
|
|
123
|
+
│ After all branches: │
|
|
124
|
+
│ • Invalidate CloudFront cache (/recorder/*) │
|
|
125
|
+
└─────────────────────────────────────────────────────────────────────┘
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Manual Trigger
|
|
129
|
+
|
|
130
|
+
You can manually trigger the embeddable-ecorder deployment:
|
|
131
|
+
|
|
132
|
+
1. Go to embeddable-ecorder → Actions → "Deploy all version branches"
|
|
133
|
+
2. Click "Run workflow"
|
|
134
|
+
3. Optionally specify a version (leave empty for latest)
|
|
135
|
+
|
|
136
|
+
## Verifying Deployment
|
|
137
|
+
|
|
138
|
+
After deployment completes:
|
|
139
|
+
|
|
140
|
+
1. Go to any production URL (e.g., https://www.covideo.com/api/elead/)
|
|
141
|
+
2. Hard refresh (Cmd+Shift+R or Ctrl+Shift+R)
|
|
142
|
+
3. Open DevTools → Network tab
|
|
143
|
+
4. Look for `react-covideo-embed-version` header in requests
|
|
144
|
+
5. Verify it matches the deployed version
|
|
145
|
+
|
|
146
|
+
## Troubleshooting
|
|
147
|
+
|
|
148
|
+
### Workflow not triggering
|
|
149
|
+
- Ensure `ECORDER_DEPLOY_TOKEN` has correct permissions
|
|
150
|
+
- Check that the token hasn't expired
|
|
151
|
+
- Verify the repository dispatch event was sent (check react-covideo-embed Actions logs)
|
|
152
|
+
|
|
153
|
+
### S3 upload failing
|
|
154
|
+
- Verify AWS credentials are valid
|
|
155
|
+
- Check IAM policy has required permissions
|
|
156
|
+
- Ensure bucket name is correct
|
|
157
|
+
|
|
158
|
+
### CloudFront not updating
|
|
159
|
+
- Invalidation can take a few minutes
|
|
160
|
+
- Verify distribution ID is correct
|
|
161
|
+
- Check invalidation status in AWS CloudFront Console
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
name: Publish to npm and trigger deployments
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
id-token: write
|
|
14
|
+
outputs:
|
|
15
|
+
version: ${{ steps.get_version.outputs.version }}
|
|
16
|
+
should_publish: ${{ steps.check_version.outputs.should_publish }}
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- name: Checkout repository
|
|
20
|
+
uses: actions/checkout@v4
|
|
21
|
+
with:
|
|
22
|
+
fetch-depth: 2
|
|
23
|
+
|
|
24
|
+
- name: Setup Node.js
|
|
25
|
+
uses: actions/setup-node@v4
|
|
26
|
+
with:
|
|
27
|
+
node-version: '18'
|
|
28
|
+
registry-url: 'https://registry.npmjs.org'
|
|
29
|
+
|
|
30
|
+
- name: Check if version changed
|
|
31
|
+
id: check_version
|
|
32
|
+
run: |
|
|
33
|
+
# Get current version from package.json
|
|
34
|
+
CURRENT_VERSION=$(node -p "require('./package.json').version")
|
|
35
|
+
|
|
36
|
+
# Check if this commit changed package.json version
|
|
37
|
+
git diff HEAD~1 HEAD --name-only | grep -q "package.json" || {
|
|
38
|
+
echo "should_publish=false" >> $GITHUB_OUTPUT
|
|
39
|
+
echo "No package.json changes, skipping publish"
|
|
40
|
+
exit 0
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
# Check if version line changed
|
|
44
|
+
if git diff HEAD~1 HEAD -- package.json | grep -q '"version"'; then
|
|
45
|
+
echo "should_publish=true" >> $GITHUB_OUTPUT
|
|
46
|
+
echo "Version changed to $CURRENT_VERSION, will publish"
|
|
47
|
+
else
|
|
48
|
+
echo "should_publish=false" >> $GITHUB_OUTPUT
|
|
49
|
+
echo "Version not changed, skipping publish"
|
|
50
|
+
fi
|
|
51
|
+
|
|
52
|
+
- name: Get package version
|
|
53
|
+
id: get_version
|
|
54
|
+
if: steps.check_version.outputs.should_publish == 'true'
|
|
55
|
+
run: |
|
|
56
|
+
VERSION=$(node -p "require('./package.json').version")
|
|
57
|
+
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
58
|
+
echo "Package version: $VERSION"
|
|
59
|
+
|
|
60
|
+
- name: Install dependencies
|
|
61
|
+
if: steps.check_version.outputs.should_publish == 'true'
|
|
62
|
+
run: npm ci
|
|
63
|
+
|
|
64
|
+
- name: Build package
|
|
65
|
+
if: steps.check_version.outputs.should_publish == 'true'
|
|
66
|
+
run: |
|
|
67
|
+
rm -rf build
|
|
68
|
+
npm run build
|
|
69
|
+
|
|
70
|
+
- name: Publish to npm
|
|
71
|
+
if: steps.check_version.outputs.should_publish == 'true'
|
|
72
|
+
run: npm publish --provenance --access public
|
|
73
|
+
|
|
74
|
+
trigger-deployments:
|
|
75
|
+
needs: publish
|
|
76
|
+
if: needs.publish.outputs.should_publish == 'true'
|
|
77
|
+
runs-on: ubuntu-latest
|
|
78
|
+
|
|
79
|
+
steps:
|
|
80
|
+
- name: Trigger embeddable-ecorder deployment
|
|
81
|
+
uses: peter-evans/repository-dispatch@v3
|
|
82
|
+
with:
|
|
83
|
+
token: ${{ secrets.ECORDER_DEPLOY_TOKEN }}
|
|
84
|
+
repository: covideodevteam/embeddable-ecorder
|
|
85
|
+
event-type: react-covideo-embed-published
|
|
86
|
+
client-payload: '{"version": "${{ needs.publish.outputs.version }}", "ref": "${{ github.sha }}"}'
|
|
87
|
+
|
|
88
|
+
- name: Log dispatch
|
|
89
|
+
run: |
|
|
90
|
+
echo "Dispatched deployment event for version ${{ needs.publish.outputs.version }}"
|
|
91
|
+
echo "Target repository: covideodevteam/embeddable-ecorder"
|