From 3451930af4b84e11227fa356fc990ea81ca33c79 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Wed, 15 Feb 2023 17:50:02 -0500 Subject: [PATCH 01/12] perf: try using registry --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index f7217e247..2f3154189 100644 --- a/action.yml +++ b/action.yml @@ -10,4 +10,4 @@ inputs: required: true runs: using: docker - image: Dockerfile + image: 'docker://ghcr.io/readmeio/rdme:next' From 4d7648e091ae9d46db5bc95b80dd88673b3caf2e Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Thu, 16 Feb 2023 10:29:57 -0600 Subject: [PATCH 02/12] chore(temp): what happens if we try this? --- .github/workflows/ci.yml | 4 ++-- .github/workflows/docs.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4c1ea763a..b54dd902f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,12 +52,12 @@ jobs: repository: readmeio/oas-examples - name: Run `openapi:validate` command - uses: ./rdme-repo/ + uses: readmeio/rdme@3451930af4b84e11227fa356fc990ea81ca33c79 with: rdme: openapi:validate oas-examples-repo/3.1/json/petstore.json # Docs: https://rdme-test.readme.io - name: Run `openapi` command - uses: ./rdme-repo/ + uses: readmeio/rdme@3451930af4b84e11227fa356fc990ea81ca33c79 with: rdme: openapi oas-examples-repo/3.1/json/petstore.json --key=${{ secrets.RDME_TEST_PROJECT_API_KEY }} --id=${{ secrets.RDME_TEST_PROJECT_API_SETTING }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e0d105643..ea5f5dd3f 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -48,7 +48,7 @@ jobs: # First we're going to perform a dry run of syncing process. # We do this on every push to ensure that an actual sync will work properly - name: Sync docs to ReadMe (dry run) - uses: ./ + uses: readmeio/rdme@3451930af4b84e11227fa356fc990ea81ca33c79 with: rdme: docs ./documentation --key=${{ secrets.README_DEVELOPERS_API_KEY }} --version=${{ vars.README_DEVELOPERS_MAIN_VERSION }} --dryRun From a0cb89f10644e213bae017c79ad5bb26c5cad7b1 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Fri, 3 Mar 2023 16:03:39 -0600 Subject: [PATCH 03/12] Revert "chore(temp): what happens if we try this?" This reverts commit 4d7648e091ae9d46db5bc95b80dd88673b3caf2e. --- .github/workflows/ci.yml | 4 ++-- .github/workflows/docs.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b54dd902f..4c1ea763a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,12 +52,12 @@ jobs: repository: readmeio/oas-examples - name: Run `openapi:validate` command - uses: readmeio/rdme@3451930af4b84e11227fa356fc990ea81ca33c79 + uses: ./rdme-repo/ with: rdme: openapi:validate oas-examples-repo/3.1/json/petstore.json # Docs: https://rdme-test.readme.io - name: Run `openapi` command - uses: readmeio/rdme@3451930af4b84e11227fa356fc990ea81ca33c79 + uses: ./rdme-repo/ with: rdme: openapi oas-examples-repo/3.1/json/petstore.json --key=${{ secrets.RDME_TEST_PROJECT_API_KEY }} --id=${{ secrets.RDME_TEST_PROJECT_API_SETTING }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index ea5f5dd3f..e0d105643 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -48,7 +48,7 @@ jobs: # First we're going to perform a dry run of syncing process. # We do this on every push to ensure that an actual sync will work properly - name: Sync docs to ReadMe (dry run) - uses: readmeio/rdme@3451930af4b84e11227fa356fc990ea81ca33c79 + uses: ./ with: rdme: docs ./documentation --key=${{ secrets.README_DEVELOPERS_API_KEY }} --version=${{ vars.README_DEVELOPERS_MAIN_VERSION }} --dryRun From 9b03ac8f206c4b16c75b3ebf4aab95809b85f856 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Fri, 3 Mar 2023 16:04:07 -0600 Subject: [PATCH 04/12] chore: try building exe --- Dockerfile | 12 +++++++++--- action.yml | 2 +- package.json | 3 +++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index d4d0dff32..7d2fc8d0c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,13 @@ -FROM node:16-alpine +FROM node:16-alpine as builder COPY . /rdme -RUN cd /rdme && npm ci && npm run build +RUN cd /rdme && npm ci && npm run build && npx pkg . --target host --out-path exe -CMD ["sh", "-c", "/rdme/bin/rdme $INPUT_RDME"] +# # A distroless container image with some basics like SSL certificates +# # https://github.com/GoogleContainerTools/distroless +FROM gcr.io/distroless/static-debian11:debug + +COPY --from=builder /rdme/exe /exe + +ENTRYPOINT ["sh", "-c", "/exe/rdme $INPUT_RDME"] diff --git a/action.yml b/action.yml index 2f3154189..f7217e247 100644 --- a/action.yml +++ b/action.yml @@ -10,4 +10,4 @@ inputs: required: true runs: using: docker - image: 'docker://ghcr.io/readmeio/rdme:next' + image: Dockerfile diff --git a/package.json b/package.json index 97ad44fe1..e84d072ed 100644 --- a/package.json +++ b/package.json @@ -136,5 +136,8 @@ ] } }, + "pkg": { + "assets": "dist/config/**/*" + }, "prettier": "@readme/eslint-config/prettier" } From f1eaccc7466bfb409740adb75a9b8cd6b77ba7e6 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Fri, 3 Mar 2023 16:22:07 -0600 Subject: [PATCH 05/12] chore: try this instead --- Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7d2fc8d0c..5a7fe07cd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,8 +6,12 @@ RUN cd /rdme && npm ci && npm run build && npx pkg . --target host --out-path ex # # A distroless container image with some basics like SSL certificates # # https://github.com/GoogleContainerTools/distroless -FROM gcr.io/distroless/static-debian11:debug +FROM node:16-alpine +# FROM gcr.io/distroless/static-debian11 COPY --from=builder /rdme/exe /exe +RUN ls -al +RUN cd exe && ls -al + ENTRYPOINT ["sh", "-c", "/exe/rdme $INPUT_RDME"] From 469eb1859e51d80eb4e9d79f81989af9fc2b727d Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Fri, 3 Mar 2023 16:31:03 -0600 Subject: [PATCH 06/12] chore: can we got smaller? --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5a7fe07cd..c401ec3a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,8 +6,8 @@ RUN cd /rdme && npm ci && npm run build && npx pkg . --target host --out-path ex # # A distroless container image with some basics like SSL certificates # # https://github.com/GoogleContainerTools/distroless -FROM node:16-alpine -# FROM gcr.io/distroless/static-debian11 +# FROM node:16-alpine +FROM gcr.io/distroless/base-debian11 COPY --from=builder /rdme/exe /exe From aa963feae301da666f8c5d59a2fc042ca478b48e Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Fri, 3 Mar 2023 16:35:35 -0600 Subject: [PATCH 07/12] chore: what about this? --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c401ec3a5..388d520f1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ RUN cd /rdme && npm ci && npm run build && npx pkg . --target host --out-path ex # # A distroless container image with some basics like SSL certificates # # https://github.com/GoogleContainerTools/distroless # FROM node:16-alpine -FROM gcr.io/distroless/base-debian11 +FROM gcr.io/distroless/cc-debian11 COPY --from=builder /rdme/exe /exe From 17e76cfe226c8ee8a60c0ffc868d0b827c089dff Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Fri, 3 Mar 2023 16:44:38 -0600 Subject: [PATCH 08/12] chore: try this --- Dockerfile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 388d520f1..8d2d59cb6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,11 +7,8 @@ RUN cd /rdme && npm ci && npm run build && npx pkg . --target host --out-path ex # # A distroless container image with some basics like SSL certificates # # https://github.com/GoogleContainerTools/distroless # FROM node:16-alpine -FROM gcr.io/distroless/cc-debian11 +FROM gcr.io/distroless/static-debian11 COPY --from=builder /rdme/exe /exe -RUN ls -al -RUN cd exe && ls -al - -ENTRYPOINT ["sh", "-c", "/exe/rdme $INPUT_RDME"] +ENTRYPOINT ["/exe/rdme $INPUT_RDME"] From c0221fb16e51ac2243359827dd35cb61c492f924 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Fri, 3 Mar 2023 16:47:03 -0600 Subject: [PATCH 09/12] chore: what about this? --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8d2d59cb6..64799c383 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,4 +11,4 @@ FROM gcr.io/distroless/static-debian11 COPY --from=builder /rdme/exe /exe -ENTRYPOINT ["/exe/rdme $INPUT_RDME"] +ENTRYPOINT ["/exe/rdme", "$INPUT_RDME"] From b08f384f1b2cbedaa270412f06f00ec65b42dec3 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Fri, 3 Mar 2023 17:57:36 -0600 Subject: [PATCH 10/12] chore: okay i feel good about this! --- Dockerfile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 64799c383..af92766b9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,11 +4,8 @@ COPY . /rdme RUN cd /rdme && npm ci && npm run build && npx pkg . --target host --out-path exe -# # A distroless container image with some basics like SSL certificates -# # https://github.com/GoogleContainerTools/distroless -# FROM node:16-alpine -FROM gcr.io/distroless/static-debian11 +FROM alpine:3.14 COPY --from=builder /rdme/exe /exe -ENTRYPOINT ["/exe/rdme", "$INPUT_RDME"] +ENTRYPOINT ["sh", "-c", "/exe/rdme $INPUT_RDME"] From 0d87eab437d18121e9a0b5d1c0e3ec65fdcfd520 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Fri, 3 Mar 2023 18:13:54 -0600 Subject: [PATCH 11/12] chore: try something quick --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4c1ea763a..bd5082277 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,7 @@ jobs: - name: Run `openapi:validate` command uses: ./rdme-repo/ with: - rdme: openapi:validate oas-examples-repo/3.1/json/petstore.json + rdme: validate oas-examples-repo/3.1/json/petstore.json # Docs: https://rdme-test.readme.io - name: Run `openapi` command From 1a98a0a2f988504aed09ac0ed88e43d9920c5f3e Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Fri, 3 Mar 2023 18:14:15 -0600 Subject: [PATCH 12/12] Revert "chore: try something quick" This reverts commit 0d87eab437d18121e9a0b5d1c0e3ec65fdcfd520. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bd5082277..4c1ea763a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,7 @@ jobs: - name: Run `openapi:validate` command uses: ./rdme-repo/ with: - rdme: validate oas-examples-repo/3.1/json/petstore.json + rdme: openapi:validate oas-examples-repo/3.1/json/petstore.json # Docs: https://rdme-test.readme.io - name: Run `openapi` command