Skip to content

Commit

Permalink
Modify config for GitHub Action supporting monorepo
Browse files Browse the repository at this point in the history
GitHub Action now supports releasing from a monorepo,
therefore we can start using those capabilities in
this repository.
1) Change from `docker` object to `dockerImages`
array in configuration
2) Rename `path` to `dockerfilePath`
3) Add `appName` keys to differentiate applications
4) Modify Dockerfile to accept `APP_TO_BUILD` argument
and utilize this argument in the configuration
  • Loading branch information
Pl217 committed Jun 14, 2024
1 parent bb7c13c commit 7fb687b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 13 deletions.
43 changes: 31 additions & 12 deletions .github/workflow.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,38 @@
"stagingEnvironmentBranch": "env/stage",
"repoType": "node",
"developmentEnvironmentBranches": ["env/red.dev", "env/blue.dev"],
"docker": {
"path": ".",
"args": {
"commitSha": "COMMIT_SHA",
"treeSha": "TREE_SHA"
},
"environmentVariables": {
"commitSha": "HPC_ACTIONS_COMMIT_SHA",
"treeSha": "HPC_ACTIONS_TREE_SHA"
"dockerImages": [
{
"dockerfilePath": ".",
"appName": "hpc-cdm",
"args": {
"commitSha": "COMMIT_SHA",
"treeSha": "TREE_SHA",
"appToBuild": "APP_TO_BUILD"
},
"environmentVariables": {
"commitSha": "HPC_ACTIONS_COMMIT_SHA",
"treeSha": "HPC_ACTIONS_TREE_SHA"
},
"repository": "public.ecr.aws/unocha/hpc-cdm",
"skipLogin": true
},
"repository": "public.ecr.aws/unocha/hpc-cdm",
"skipLogin": true
},
{
"dockerfilePath": ".",
"appName": "hpc-ftsadmin",
"args": {
"commitSha": "COMMIT_SHA",
"treeSha": "TREE_SHA",
"appToBuild": "APP_TO_BUILD"
},
"environmentVariables": {
"commitSha": "HPC_ACTIONS_COMMIT_SHA",
"treeSha": "HPC_ACTIONS_TREE_SHA"
},
"repository": "public.ecr.aws/unocha/hpc-ftsadmin",
"skipLogin": true
}
],
"ci": ["./.github/ci.sh"],
"mergebackLabels": ["mergeback"],
"deployments": {
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ FROM public.ecr.aws/unocha/nodejs-builder:20-alpine AS builder
WORKDIR /srv/src
COPY . .
ARG ENVIRONMENT=production
ARG APP_TO_BUILD
RUN npm run remove-unneeded-deps && \
npm install && \
# Output path is relative to working directory
npm run build hpc-cdm -- --output-path=dist/ --configuration=$ENVIRONMENT
npm run build ${APP_TO_BUILD} -- --output-path=dist/ --configuration=$ENVIRONMENT

FROM public.ecr.aws/unocha/nginx:stable-beagle

Expand Down

0 comments on commit 7fb687b

Please sign in to comment.