Base template to deploy your next source function
- Click
Use This Templateabove
- (If Segment PS, add to
Segment Services EngineeringOrganization
nvm use(to get the right version of NodeJS)npm install(to install npm dependencies)
npm run test
- GitHub Actions workflow also runs tests before deploying
- Tests are created in
src/index.test.js
-
Create GitHub Environments in
SettingsโEnvironmentsโDEVDEVis enabled by default in the.github/workflows/deployFunction.ymlfile- (repeat for
QA&PROD)
-
Create Source Function in Segment Workspace
-
Connect Source Function to a Segment Source
-
Create Public API Token to allow for deploying
-
Add the following Environment Secrets
FUNCTION_ID(include thesfnc_part of the function id)SOURCE_ID(available in the Source Settings โ API Keys tab)PUBLIC_API_TOKEN(Get an API Token)
- Once changes look good in the DEV environment, uncomment the QA section from
the
deployFunction.ymlfile. - Push changes to your branch
- Add the label
!!_RELEASE_TO_QAto the PR to deploy it to QA- (ensure a
QAGitHub Environment has been created)
- (ensure a
- If ready to deploy to PROD, uncomment the PROD section from the
deployFunction.ymlfile & merge the PR (ensure aPRODGitHub Environment has been created)


