The project does not currently have a CI/CD setup in place. As a next step, consider implementing CI/CD automation for the project to streamline the development workflow. Below is a structured approach to get started with CI/CD automation scripts for the project.
Next Steps for CI/CD Setup
Define CI/CD Goals: Determine the objectives for automation, such as automated testing, build processes, and deployment.
Choose a CI/CD Tool: Decide whether to use GitHub Actions, CircleCI, Travis CI, etc. For this example, we will utilize GitHub Actions due to the existing
.github/
directory.Create Workflow Files: The workflow file defines the automation process. A minimal setup can be initiated using the existing
.github/workflows/publish.yaml
file.Example Workflow: Below is an example GitHub Actions workflow that could be extended for CI/CD purposes, found in
.github/workflows/publish.yaml
.
name: CI/CD Pipeline
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install Dependencies
run: |
cd embed
npm install
- name: Build Project
run: |
cd embed
npm run build
- name: Run Tests
run: |
cd embed
npm run test
- name: Deploy
if: github.event_name == 'push'
run: |
echo "Deployment step would go here."
Key Components Explained
Triggers: The workflow is triggered on
push
andpull_request
events on themain
branch.Jobs: A single job named
build
runs on the latest version of Ubuntu.Checkout Code: Uses
actions/checkout@v2
to pull the project code.Node Setup: The workflow uses
actions/setup-node@v2
to set the Node.js environment.Install Dependencies: Installs necessary packages by navigating into the
embed
directory and runningnpm install
.Build Project: This step builds the project with
npm run build
. Ensure that thebuild
script is defined inembed/package.json
.Run Tests: Executes tests using
npm run test
. Ensure that tests are defined in thepackage.json
.Deployment Placeholder: A placeholder is included to indicate where deployment procedures should be included. This needs to be tailored according to the chosen deployment strategy.
Example Package JSON
The following example illustrates what the scripts
section might look like in embed/package.json
pertaining to build and test processes:
{
"name": "embed",
"version": "1.0.0",
"scripts": {
"build": "vite build",
"test": "jest"
},
"devDependencies": {
"vite": "^2.6.14",
"jest": "^27.0.6"
}
}
In summary, while CI/CD is not currently set up, the information provided outlines a thorough overview of how to start setting up CI/CD automation for the project, utilizing GitHub Actions along with TypeScript and HTML components.
Source: Project directory structure provided.