File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222** /secrets.dev.yaml
2323** /values.dev.yaml
2424LICENSE
25- README.md
25+ README.md
26+ ** /out
27+ package-lock.json
Original file line number Diff line number Diff line change 1+ name : Publish Docker image
2+
3+ on :
4+ push :
5+ branches : [ "main", "build" ]
6+ pull_request :
7+ branches : [ "main" ]
8+ release :
9+ types : [published]
10+
11+ jobs :
12+ push_to_registry :
13+ name : Push Docker image to Docker Hub
14+ runs-on : ubuntu-latest
15+ steps :
16+ - name : Check out the repo
17+ uses : actions/checkout@v3
18+
19+ - name : Log in to Docker Hub
20+ uses : docker/login-action@v2.1.0
21+ with :
22+ username : ${{ secrets.DOCKER_USERNAME }}
23+ password : ${{ secrets.DOCKER_PASSWORD }}
24+ - name : Extract metadata (tags, labels) for Docker
25+ id : meta
26+ uses : docker/metadata-action@v4.3.0
27+ with :
28+ images : trfc/github-teams-user-sync
29+ - name : Build and push Docker image
30+ uses : docker/build-push-action@v3.3.0
31+ with :
32+ context : .
33+ push : true
34+ tags : ${{ steps.meta.outputs.tags }}
35+ labels : ${{ steps.meta.outputs.labels }}
36+ file : Dockerfile
Original file line number Diff line number Diff line change 1+ FROM node:18 AS Build
2+ ARG NPM_REGISTRY
3+ WORKDIR /usr/src/app
4+ COPY . .
5+ RUN npm config set registry ${NPM_REGISTRY} && \
6+ npm install && \
7+ npm run build && \
8+ npm ci --omit=dev
9+
10+ FROM node:18-alpine
11+
12+ COPY --chown=node --from=Build /usr/src/app/package.json /usr/src/app/package.json
13+ COPY --chown=node --from=Build /usr/src/app/node_modules /usr/src/app/node_modules
14+ COPY --chown=node --from=Build /usr/src/app/out/src/ /usr/src/app/out/src/
15+
16+ USER node
17+
18+ WORKDIR /usr/src/app
19+
20+ CMD npm run start
Original file line number Diff line number Diff line change 22 "name" : " teams-sync-rewrite" ,
33 "version" : " 1.0.0" ,
44 "description" : " " ,
5- "main" : " index.js " ,
5+ "main" : " app.ts " ,
66 "scripts" : {
77 "test" : " echo \" Error: no test specified\" && exit 1" ,
8- "start" : " nodemon" ,
8+ "dev" : " nodemon" ,
9+ "start" : " node ./out/src/app.js" ,
10+ "build" : " tsc && shx cp ./src/openapi.yaml ./out/src/openapi.yaml" ,
911 "openapi" : " npx -y openapi-to-ts -i ./src/openapi.yaml -o ./src/types/sync-models.d.ts" ,
1012 "play" : " ts-node playground.ts"
1113 },
1719 "@types/ldapjs" : " ^2.2.5" ,
1820 "@types/swagger-ui-express" : " ^4.1.3" ,
1921 "nodemon" : " ^2.0.21" ,
22+ "shx" : " ^0.3.4" ,
2023 "ts-node" : " ^10.9.1" ,
2124 "typescript" : " ^5.0.2"
2225 },
3841 "ignore" : [
3942 " src/**/*.spec.ts"
4043 ],
41- "exec" : " ts-node ./src/index .ts"
44+ "exec" : " ts-node ./src/app .ts"
4245 }
4346}
File renamed without changes.
You can’t perform that action at this time.
0 commit comments