diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml deleted file mode 100644 index 825da7f..0000000 --- a/.github/workflows/release.yaml +++ /dev/null @@ -1,42 +0,0 @@ -name: release - -on: - push: - tags: - - 'github-agent/*' - -permissions: - id-token: write - contents: read - -jobs: - release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: pnpm/action-setup@v4 - - name: Install Node.js - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: pnpm - - name: Install dependencies - run: pnpm install - - name: Run build - run: pnpm -r build - - name: Authenticate with Google Cloud - uses: google-github-actions/auth@v2 - with: - token_format: access_token - project_id: dengenlabs - service_account: gar-pusher@dengenlabs.iam.gserviceaccount.com - workload_identity_provider: projects/265888598630/locations/global/workloadIdentityPools/composable-cloud/providers/github - access_token_lifetime: 300s - create_credentials_file: true - - name: Authenticate to Google Artifact Registry - run: pnpm run registry-login --repo-config=.npmrc - - name: Publish Package - run: | - # We modified the .npmrc file to use GAR, which put the Git repository in dirty state. - # So we need to disable the Git checks. - pnpm publish packages/github-agent --no-git-checks diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5e33e42..72f3663 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -43,46 +43,46 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Authenticate with Google Cloud - uses: google-github-actions/auth@v2 - id: gauth - with: - token_format: access_token - project_id: dengenlabs - service_account: gar-pusher@dengenlabs.iam.gserviceaccount.com - workload_identity_provider: projects/265888598630/locations/global/workloadIdentityPools/composable-cloud/providers/github - access_token_lifetime: 300s - create_credentials_file: true + # - name: Authenticate with Google Cloud + # uses: google-github-actions/auth@v2 + # id: gauth + # with: + # token_format: access_token + # project_id: dengenlabs + # service_account: gar-pusher@dengenlabs.iam.gserviceaccount.com + # workload_identity_provider: projects/265888598630/locations/global/workloadIdentityPools/composable-cloud/providers/github + # access_token_lifetime: 300s + # create_credentials_file: true - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v3 - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - # list of Docker images to use as base name for tags - images: | - us.gcr.io/dengenlabs/agents/vertesia/github-agent - tags: | - type=ref,event=branch - type=ref,event=pr - type=sha,format=long,prefix= + # - name: Docker meta + # id: meta + # uses: docker/metadata-action@v5 + # with: + # # list of Docker images to use as base name for tags + # images: | + # us.gcr.io/dengenlabs/agents/vertesia/github-agent + # tags: | + # type=ref,event=branch + # type=ref,event=pr + # type=sha,format=long,prefix= - - name: Login to GAR - uses: docker/login-action@v3 - with: - registry: us.gcr.io - username: oauth2accesstoken - password: ${{ steps.gauth.outputs.access_token }} + # - name: Login to GAR + # uses: docker/login-action@v3 + # with: + # registry: us.gcr.io + # username: oauth2accesstoken + # password: ${{ steps.gauth.outputs.access_token }} - - name: Build and push Docker image - uses: docker/build-push-action@v6 - with: - context: . - file: ./apps/github-agent/Dockerfile - push: ${{ github.ref == 'refs/heads/main' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - secret-files: | - "gcp=${{ steps.gauth.outputs.credentials_file_path }}" + # - name: Build and push Docker image + # uses: docker/build-push-action@v6 + # with: + # context: . + # file: ./apps/github-agent/Dockerfile + # push: ${{ github.ref == 'refs/heads/main' }} + # tags: ${{ steps.meta.outputs.tags }} + # labels: ${{ steps.meta.outputs.labels }} + # secret-files: | + # "gcp=${{ steps.gauth.outputs.credentials_file_path }}" diff --git a/apps/github-agent/Dockerfile b/apps/github-agent/Dockerfile index c8d79fd..744717d 100644 --- a/apps/github-agent/Dockerfile +++ b/apps/github-agent/Dockerfile @@ -1,28 +1,28 @@ -FROM node:23.5-slim AS base +FROM node:22-slim AS base ENV PNPM_HOME="/pnpm" ENV PATH="$PNPM_HOME:$PATH" RUN corepack enable -COPY . /app -WORKDIR /app +COPY . /workspace +WORKDIR /workspace/apps/github-agent FROM base AS prod-deps RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile FROM base AS build RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile -RUN pnpm run build +RUN pnpm run -r build FROM base RUN apt-get update -y && \ apt-get install -y openssl ca-certificates -COPY --from=prod-deps /app/node_modules /app/node_modules -COPY --from=build /app/lib /app/lib -COPY --from=build /app/bin /app/bin +COPY --from=prod-deps /workspace/node_modules /workspace/node_modules +COPY --from=build /workspace/apps/github-agent/lib /workspace/apps/github-agent/lib +COPY --from=build /workspace/apps/github-agent/bin /workspace/apps/github-agent/bin -COPY --from=datadog/serverless-init:1 /datadog-init /app/datadog-init +COPY --from=datadog/serverless-init:1 /datadog-init /workspace/datadog-init ENV SERVICE_NAME=vertesia_github-agent -ENTRYPOINT ["/app/datadog-init"] -CMD [ "pnpm", "start" ] +ENTRYPOINT ["/workspace/datadog-init"] +CMD ["pnpm", "start"]