File tree Expand file tree Collapse file tree 4 files changed +85
-4
lines changed Expand file tree Collapse file tree 4 files changed +85
-4
lines changed Original file line number Diff line number Diff line change 1+ name : Create and publish a Docker image
2+
3+ on :
4+ push :
5+
6+ env :
7+ REGISTRY : ghcr.io
8+ IMAGE_NAME : ${{ github.repository }}
9+
10+ jobs :
11+ build-and-push-image :
12+ runs-on : ubuntu-latest
13+
14+ permissions :
15+ contents : read
16+ packages : write
17+ attestations : write
18+ id-token : write
19+
20+ steps :
21+ - name : Checkout repository
22+ uses : actions/checkout@v5
23+
24+ - name : Set up Docker
25+ uses : docker/setup-docker-action@v4
26+ with :
27+ daemon-config : |
28+ {
29+ "debug": true,
30+ "features": {
31+ "containerd-snapshotter": true
32+ }
33+ }
34+
35+ - name : Log in to the Container registry
36+ uses : docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
37+ with :
38+ registry : ${{ env.REGISTRY }}
39+ username : ${{ github.actor }}
40+ password : ${{ secrets.GITHUB_TOKEN }}
41+
42+ - name : Extract metadata (tags, labels) for Docker
43+ id : meta
44+ uses : docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
45+ with :
46+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
47+
48+ - name : Set up QEMU
49+ uses : docker/setup-qemu-action@v3
50+
51+ - name : Build and push Docker image
52+ id : push
53+ uses : docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
54+ with :
55+ context : .
56+ push : true
57+ platforms : linux/amd64,linux/arm64
58+ tags : ${{ steps.meta.outputs.tags }}
59+ labels : ${{ steps.meta.outputs.labels }}
60+
61+
Original file line number Diff line number Diff line change 1+ FROM node:20-slim AS base
2+ ENV PNPM_HOME="/pnpm"
3+ ENV PATH="$PNPM_HOME:$PATH"
4+ RUN corepack enable
5+ COPY . /app
6+ WORKDIR /app
7+
8+ FROM base AS prod-deps
9+ RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
10+
11+ FROM base AS build
12+ RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
13+ RUN pnpm run build
14+
15+ FROM base
16+ COPY --from=prod-deps /app/node_modules /app/node_modules
17+ COPY --from=build /app/dist /app/dist
18+ EXPOSE 3000
19+ CMD [ "node" , "dist/index.js" , "http" ]
Original file line number Diff line number Diff line change 4242 "lint:fix" : " eslint src/**/*.ts --fix" ,
4343 "build" : " tsup" ,
4444 "build:watch" : " tsup --watch" ,
45- "generate-types" : " dtsgen -c dtsgen.json -o src/types/argocd.d.ts swagger.json" ,
46- "prepare" : " npm run build"
45+ "generate-types" : " dtsgen -c dtsgen.json -o src/types/argocd.d.ts swagger.json"
4746 },
4847 "author" : " Argo Proj Contributors." ,
4948 "license" : " Apache-2.0" ,
Original file line number Diff line number Diff line change @@ -62,8 +62,10 @@ export const connectHttpTransport = (port: number) => {
6262 if ( sessionIdFromHeader && httpTransports [ sessionIdFromHeader ] ) {
6363 transport = httpTransports [ sessionIdFromHeader ] ;
6464 } else if ( ! sessionIdFromHeader && isInitializeRequest ( req . body ) ) {
65- const argocdBaseUrl = ( req . headers [ 'x-argocd-base-url' ] as string ) || '' ;
66- const argocdApiToken = ( req . headers [ 'x-argocd-api-token' ] as string ) || '' ;
65+ const argocdBaseUrl =
66+ ( req . headers [ 'x-argocd-base-url' ] as string ) || process . env . ARGOCD_BASE_URL || '' ;
67+ const argocdApiToken =
68+ ( req . headers [ 'x-argocd-api-token' ] as string ) || process . env . ARGOCD_API_TOKEN || '' ;
6769
6870 if ( argocdBaseUrl == '' || argocdApiToken == '' ) {
6971 res
You can’t perform that action at this time.
0 commit comments