From d5a540aff903dede14dfc20ffd3757890b6f9afe Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Wed, 14 Aug 2024 22:15:32 -0700 Subject: [PATCH 01/31] github actions for building & linting docs site --- .github/workflows/ci.yaml | 59 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..d536b47 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,59 @@ +name: CI +on: [push, pull_request] + +jobs: + build: + name: Build + runs-on: gha-runner-x64 + + steps: + - uses: actions/checkout@v4 + + - name: Set Node.js 20.x + uses: actions/setup-node@v3 + with: + node-version: 20.x + + - name: yarn@4.1.1 + run: | + corepack enable && corepack prepare yarn@4.1.1 + + - name: Install dependencies + uses: borales/actions-yarn@v4.2.0 + with: + cmd: install --frozen-lockfile + + - name: Build + uses: borales/actions-yarn@v4.2.0 + with: + cmd: build + env: + NODE_OPTIONS: --openssl-legacy-provider + + lint: + name: Linter + runs-on: gha-runner-x64 + + steps: + - uses: actions/checkout@v4 + + - name: Set Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: 20.x + + - name: yarn@4.1.1 + run: | + corepack enable && corepack prepare yarn@4.1.1 + + - name: Install dependencies + uses: borales/actions-yarn@v4.2.0 + with: + cmd: install --frozen-lockfile + + - name: Build + uses: borales/actions-yarn@v4.2.0 + with: + cmd: lint + env: + NODE_OPTIONS: --openssl-legacy-provider \ No newline at end of file From 10fb2b60b863be6d4faaae011d8aaa275c9092a8 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Wed, 14 Aug 2024 22:52:05 -0700 Subject: [PATCH 02/31] use ubuntu-latest --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d536b47..cb17bf0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -4,7 +4,7 @@ on: [push, pull_request] jobs: build: name: Build - runs-on: gha-runner-x64 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -32,7 +32,7 @@ jobs: lint: name: Linter - runs-on: gha-runner-x64 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From 90c725b80db6f0726987032546e6f74aad26a8f6 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Wed, 14 Aug 2024 22:59:30 -0700 Subject: [PATCH 03/31] test --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index cb17bf0..d536b47 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -4,7 +4,7 @@ on: [push, pull_request] jobs: build: name: Build - runs-on: ubuntu-latest + runs-on: gha-runner-x64 steps: - uses: actions/checkout@v4 @@ -32,7 +32,7 @@ jobs: lint: name: Linter - runs-on: ubuntu-latest + runs-on: gha-runner-x64 steps: - uses: actions/checkout@v4 From 92c6f72c65f04f4b4ee4eebf6cb8c96a637efcfc Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Wed, 14 Aug 2024 23:10:58 -0700 Subject: [PATCH 04/31] workflow update --- .github/workflows/ci.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d536b47..742f824 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,5 +1,8 @@ name: CI -on: [push, pull_request] +on: + pull_request: + types: [opened, synchronize, reopened] + jobs: build: @@ -21,7 +24,7 @@ jobs: - name: Install dependencies uses: borales/actions-yarn@v4.2.0 with: - cmd: install --frozen-lockfile + cmd: install --immutable - name: Build uses: borales/actions-yarn@v4.2.0 @@ -49,7 +52,7 @@ jobs: - name: Install dependencies uses: borales/actions-yarn@v4.2.0 with: - cmd: install --frozen-lockfile + cmd: install --immutable - name: Build uses: borales/actions-yarn@v4.2.0 From 8fdaf302476e663a8fe46fee512a45d1dd8b1025 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 15 Aug 2024 08:49:43 -0700 Subject: [PATCH 05/31] let's try a yarn cache --- .github/workflows/ci.yaml | 52 +++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 742f824..502b334 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -21,41 +21,41 @@ jobs: run: | corepack enable && corepack prepare yarn@4.1.1 + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT + + - name: Get yarn cache + uses: actions/cache@v4 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-${{ runner.arch }}-yarn-docs-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-${{ runner.arch }}-yarn-docs- + - name: Install dependencies - uses: borales/actions-yarn@v4.2.0 + uses: borales/actions-yarn@v5 + if: steps.yarn-cache.outputs.cache-hit != 'true' with: cmd: install --immutable + - name: Save yarn cache + if: steps.yarn-cache.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-${{ runner.arch }}-yarn-docs-${{ hashFiles('**/yarn.lock') }} + - name: Build - uses: borales/actions-yarn@v4.2.0 + uses: borales/actions-yarn@v5 with: cmd: build env: NODE_OPTIONS: --openssl-legacy-provider - - lint: - name: Linter - runs-on: gha-runner-x64 - - steps: - - uses: actions/checkout@v4 - - - name: Set Node.js 20.x - uses: actions/setup-node@v4 - with: - node-version: 20.x - - - name: yarn@4.1.1 - run: | - corepack enable && corepack prepare yarn@4.1.1 - - - name: Install dependencies - uses: borales/actions-yarn@v4.2.0 - with: - cmd: install --immutable - - - name: Build - uses: borales/actions-yarn@v4.2.0 + + - name: Lint + uses: borales/actions-yarn@v5 with: cmd: lint env: From ad3051730b9f13b1c6a39b3b3f1f67c99534db04 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 15 Aug 2024 08:58:07 -0700 Subject: [PATCH 06/31] remove conditional on yarn install --- .github/workflows/ci.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 502b334..a69e447 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -36,7 +36,6 @@ jobs: - name: Install dependencies uses: borales/actions-yarn@v5 - if: steps.yarn-cache.outputs.cache-hit != 'true' with: cmd: install --immutable From 70a406810847029154caf6042e9bcd724b48f4e5 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 15 Aug 2024 09:04:14 -0700 Subject: [PATCH 07/31] looks like explicitly saving isn't necessary --- .github/workflows/ci.yaml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a69e447..cfbdf4c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -39,13 +39,6 @@ jobs: with: cmd: install --immutable - - name: Save yarn cache - if: steps.yarn-cache.outputs.cache-hit != 'true' - uses: actions/cache/save@v4 - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-${{ runner.arch }}-yarn-docs-${{ hashFiles('**/yarn.lock') }} - - name: Build uses: borales/actions-yarn@v5 with: From 7182f7a8af83f34eef4d8201344b000e5f5a1be3 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 15 Aug 2024 09:04:29 -0700 Subject: [PATCH 08/31] looks like explicitly saving the cache isn't required --- .github/workflows/ci.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index cfbdf4c..0101727 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -39,6 +39,13 @@ jobs: with: cmd: install --immutable + # - name: Save yarn cache + # if: steps.yarn-cache.outputs.cache-hit != 'true' + # uses: actions/cache/save@v4 + # with: + # path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + # key: ${{ runner.os }}-${{ runner.arch }}-yarn-docs-${{ hashFiles('**/yarn.lock') }} + - name: Build uses: borales/actions-yarn@v5 with: From aa3d9cf3a18d6b2f434195b4684be072e797b0f7 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 15 Aug 2024 12:17:10 -0700 Subject: [PATCH 09/31] try a docker build --- .github/workflows/ci.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0101727..9c654fc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -58,4 +58,7 @@ jobs: with: cmd: lint env: - NODE_OPTIONS: --openssl-legacy-provider \ No newline at end of file + NODE_OPTIONS: --openssl-legacy-provider + + - name: Docker Build + run: build -t us-central1-docker.pkg.dev/zerotier-d648c7/zt-docker/docs-zerotier-com:${{ github.sha }} . --push \ No newline at end of file From 6ad2e6208c7e0a802fb281ff6d8f3100e4dffda5 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 15 Aug 2024 12:21:16 -0700 Subject: [PATCH 10/31] oops --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9c654fc..3636a50 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -61,4 +61,4 @@ jobs: NODE_OPTIONS: --openssl-legacy-provider - name: Docker Build - run: build -t us-central1-docker.pkg.dev/zerotier-d648c7/zt-docker/docs-zerotier-com:${{ github.sha }} . --push \ No newline at end of file + run: docker build -t us-central1-docker.pkg.dev/zerotier-d648c7/zt-docker/docs-zerotier-com:${{ github.sha }} . --push \ No newline at end of file From 0641f056e10e21d1c6f8e7667f466563bb5dcd16 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 15 Aug 2024 12:27:55 -0700 Subject: [PATCH 11/31] should auth here --- .github/workflows/ci.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3636a50..23fd8bb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -60,5 +60,7 @@ jobs: env: NODE_OPTIONS: --openssl-legacy-provider + - name: 'Set up Cloud SDK' + uses: 'google-github-actions/setup-gcloud@v2' - name: Docker Build run: docker build -t us-central1-docker.pkg.dev/zerotier-d648c7/zt-docker/docs-zerotier-com:${{ github.sha }} . --push \ No newline at end of file From 125bb0f813f97655db00b1e32b2eb13412222c75 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 15 Aug 2024 12:36:18 -0700 Subject: [PATCH 12/31] setup --- .github/workflows/ci.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 23fd8bb..9a627c0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -63,4 +63,6 @@ jobs: - name: 'Set up Cloud SDK' uses: 'google-github-actions/setup-gcloud@v2' - name: Docker Build - run: docker build -t us-central1-docker.pkg.dev/zerotier-d648c7/zt-docker/docs-zerotier-com:${{ github.sha }} . --push \ No newline at end of file + run: | + gcloud auth configure-docker ${{ secrets.GCLOUD_DOCKER_HOST }} + docker build -t ${{ secrets.GCLOUD_DOCKER_HOST }}/${{ secrets.GCLOUD_PROJECT_ID }}}/zt-docker/docs-zerotier-com:${{ github.sha }} . --push \ No newline at end of file From ad1ea5df0a5224e585225fb1b86e77c9220c2343 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 15 Aug 2024 12:40:42 -0700 Subject: [PATCH 13/31] one too many brackets --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9a627c0..446ba76 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -65,4 +65,4 @@ jobs: - name: Docker Build run: | gcloud auth configure-docker ${{ secrets.GCLOUD_DOCKER_HOST }} - docker build -t ${{ secrets.GCLOUD_DOCKER_HOST }}/${{ secrets.GCLOUD_PROJECT_ID }}}/zt-docker/docs-zerotier-com:${{ github.sha }} . --push \ No newline at end of file + docker build -t ${{ secrets.GCLOUD_DOCKER_HOST }}/${{ secrets.GCLOUD_PROJECT_ID }}/zt-docker/docs-zerotier-com:${{ github.sha }} . --push \ No newline at end of file From 65cd292110ab26c83e89d882251c95b47e871df8 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 15 Aug 2024 13:20:43 -0700 Subject: [PATCH 14/31] hmm --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 446ba76..c0fa106 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -64,5 +64,6 @@ jobs: uses: 'google-github-actions/setup-gcloud@v2' - name: Docker Build run: | + gcloud info gcloud auth configure-docker ${{ secrets.GCLOUD_DOCKER_HOST }} docker build -t ${{ secrets.GCLOUD_DOCKER_HOST }}/${{ secrets.GCLOUD_PROJECT_ID }}/zt-docker/docs-zerotier-com:${{ github.sha }} . --push \ No newline at end of file From 4d28b0ec3140b207dc0514ece6cf21f8f5f81948 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 15 Aug 2024 14:53:59 -0700 Subject: [PATCH 15/31] hmm --- .github/workflows/ci.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c0fa106..eb1eaf1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -62,6 +62,9 @@ jobs: - name: 'Set up Cloud SDK' uses: 'google-github-actions/setup-gcloud@v2' + with: + credentials_json: ${{ secrets.DOCKER_REGISTRY_WRITER }} + - name: Docker Build run: | gcloud info From 0c2b2b1f3d03d9717522326de391e51a48d54677 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 15 Aug 2024 14:59:25 -0700 Subject: [PATCH 16/31] . --- .github/workflows/ci.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index eb1eaf1..b8efbeb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -60,11 +60,14 @@ jobs: env: NODE_OPTIONS: --openssl-legacy-provider + - id: 'auth' + uses: 'google-github-actions/auth@v2' + with: + credentials_json: '${{ secrets.DOCKER_REGISTRY_WRITER }}' + - name: 'Set up Cloud SDK' uses: 'google-github-actions/setup-gcloud@v2' - with: - credentials_json: ${{ secrets.DOCKER_REGISTRY_WRITER }} - + - name: Docker Build run: | gcloud info From 0b77da49ccdf41d6020933c1d8a07b72e595baff Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 15 Aug 2024 15:08:41 -0700 Subject: [PATCH 17/31] build docker for dev site on merge to main --- .github/workflows/ci.yaml | 16 +------- .github/workflows/deploy_dev.yaml | 61 +++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/deploy_dev.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b8efbeb..0101727 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -58,18 +58,4 @@ jobs: with: cmd: lint env: - NODE_OPTIONS: --openssl-legacy-provider - - - id: 'auth' - uses: 'google-github-actions/auth@v2' - with: - credentials_json: '${{ secrets.DOCKER_REGISTRY_WRITER }}' - - - name: 'Set up Cloud SDK' - uses: 'google-github-actions/setup-gcloud@v2' - - - name: Docker Build - run: | - gcloud info - gcloud auth configure-docker ${{ secrets.GCLOUD_DOCKER_HOST }} - docker build -t ${{ secrets.GCLOUD_DOCKER_HOST }}/${{ secrets.GCLOUD_PROJECT_ID }}/zt-docker/docs-zerotier-com:${{ github.sha }} . --push \ No newline at end of file + NODE_OPTIONS: --openssl-legacy-provider \ No newline at end of file diff --git a/.github/workflows/deploy_dev.yaml b/.github/workflows/deploy_dev.yaml new file mode 100644 index 0000000..d445d48 --- /dev/null +++ b/.github/workflows/deploy_dev.yaml @@ -0,0 +1,61 @@ +name: Deploy to Dev +on: + push: + branches: + - main + +jobs: + build: + name: Build + runs-on: gha-runner-x64 + + steps: + - uses: actions/checkout@v4 + + - name: Set Node.js 20.x + uses: actions/setup-node@v3 + with: + node-version: 20.x + + - name: yarn@4.1.1 + run: | + corepack enable && corepack prepare yarn@4.1.1 + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT + + - name: Get yarn cache + uses: actions/cache@v4 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-${{ runner.arch }}-yarn-docs-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-${{ runner.arch }}-yarn-docs- + + - name: Install dependencies + uses: borales/actions-yarn@v5 + with: + cmd: install --immutable + + - name: Build + uses: borales/actions-yarn@v5 + with: + cmd: build + env: + NODE_OPTIONS: --openssl-legacy-provider + + - id: 'auth' + uses: 'google-github-actions/auth@v2' + with: + credentials_json: '${{ secrets.DOCKER_REGISTRY_WRITER }}' + + - name: 'Set up Cloud SDK' + uses: 'google-github-actions/setup-gcloud@v2' + + - name: Docker Build + run: | + gcloud auth configure-docker ${{ secrets.GCLOUD_DOCKER_HOST }} + docker build -t ${{ secrets.GCLOUD_DOCKER_HOST }}/${{ secrets.GCLOUD_PROJECT_ID }}/zt-docker/docs-zerotier-com:${{ github.sha }} . --push + \ No newline at end of file From 99f8a8bcb00db26b6909f75b3652a24fc6ca579f Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 15 Aug 2024 16:22:01 -0700 Subject: [PATCH 18/31] let's try this --- .github/workflows/ci.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0101727..b2277e9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -58,4 +58,9 @@ jobs: with: cmd: lint env: - NODE_OPTIONS: --openssl-legacy-provider \ No newline at end of file + NODE_OPTIONS: --openssl-legacy-provider + + - name: Test Curl + uses: alesil/actions-curl@v1 + with: + curl: 'curl -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/zerotier/${{ secrets.INFRA_REPO_NAME }}/dispatches -d "{\"event_type\": \"deploy_docs_dev\", \"inputs\": {\"docker_tag\": \"${{ github.sha }}\"}}"' \ No newline at end of file From bbe85e2db7ef3efea4d98e237f40228bd9ac915c Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 15 Aug 2024 16:28:55 -0700 Subject: [PATCH 19/31] different curl action --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b2277e9..4c25e9e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -61,6 +61,6 @@ jobs: NODE_OPTIONS: --openssl-legacy-provider - name: Test Curl - uses: alesil/actions-curl@v1 + uses: enflo/curl-action@v1 with: - curl: 'curl -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/zerotier/${{ secrets.INFRA_REPO_NAME }}/dispatches -d "{\"event_type\": \"deploy_docs_dev\", \"inputs\": {\"docker_tag\": \"${{ github.sha }}\"}}"' \ No newline at end of file + curl: '-L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/zerotier/${{ secrets.INFRA_REPO_NAME }}/dispatches -d "{\"event_type\": \"deploy_docs_dev\", \"inputs\": {\"docker_tag\": \"${{ github.sha }}\"}}"' \ No newline at end of file From c94520e1ec96908670efeb533d2a2882631ed5c7 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 15 Aug 2024 16:41:07 -0700 Subject: [PATCH 20/31] bump --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4c25e9e..903571a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -63,4 +63,4 @@ jobs: - name: Test Curl uses: enflo/curl-action@v1 with: - curl: '-L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/zerotier/${{ secrets.INFRA_REPO_NAME }}/dispatches -d "{\"event_type\": \"deploy_docs_dev\", \"inputs\": {\"docker_tag\": \"${{ github.sha }}\"}}"' \ No newline at end of file + curl: '-L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.DEPLOY_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/zerotier/${{ secrets.INFRA_REPO_NAME }}/dispatches -d "{\"event_type\": \"deploy_docs_dev\", \"client_payload\": {\"docker_tag\": \"${{ github.sha }}\"}}"' \ No newline at end of file From b619af4de17512c9d9a2841ef2a58320a3674142 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 15 Aug 2024 16:46:42 -0700 Subject: [PATCH 21/31] quote esacping, and lets speed up the actions. no need to actually build right now --- .github/workflows/ci.yaml | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 903571a..cc7cbff 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -34,24 +34,17 @@ jobs: restore-keys: | ${{ runner.os }}-${{ runner.arch }}-yarn-docs- - - name: Install dependencies - uses: borales/actions-yarn@v5 - with: - cmd: install --immutable - - # - name: Save yarn cache - # if: steps.yarn-cache.outputs.cache-hit != 'true' - # uses: actions/cache/save@v4 + # - name: Install dependencies + # uses: borales/actions-yarn@v5 # with: - # path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - # key: ${{ runner.os }}-${{ runner.arch }}-yarn-docs-${{ hashFiles('**/yarn.lock') }} + # cmd: install --immutable - - name: Build - uses: borales/actions-yarn@v5 - with: - cmd: build - env: - NODE_OPTIONS: --openssl-legacy-provider + # - name: Build + # uses: borales/actions-yarn@v5 + # with: + # cmd: build + # env: + # NODE_OPTIONS: --openssl-legacy-provider - name: Lint uses: borales/actions-yarn@v5 @@ -63,4 +56,4 @@ jobs: - name: Test Curl uses: enflo/curl-action@v1 with: - curl: '-L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.DEPLOY_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/zerotier/${{ secrets.INFRA_REPO_NAME }}/dispatches -d "{\"event_type\": \"deploy_docs_dev\", \"client_payload\": {\"docker_tag\": \"${{ github.sha }}\"}}"' \ No newline at end of file + curl: '-L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.DEPLOY_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/zerotier/${{ secrets.INFRA_REPO_NAME }}/dispatches -d "{\\"event_type\\": \\"deploy_docs_dev\\", \\"client_payload\\": {\\"docker_tag\\": \\"${{ github.sha }}\\"}}"' \ No newline at end of file From 64512ad2a2c869066530003dc5008a2abe8268d3 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 15 Aug 2024 16:47:26 -0700 Subject: [PATCH 22/31] skip lint too --- .github/workflows/ci.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index cc7cbff..c42f30f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -46,12 +46,12 @@ jobs: # env: # NODE_OPTIONS: --openssl-legacy-provider - - name: Lint - uses: borales/actions-yarn@v5 - with: - cmd: lint - env: - NODE_OPTIONS: --openssl-legacy-provider + # - name: Lint + # uses: borales/actions-yarn@v5 + # with: + # cmd: lint + # env: + # NODE_OPTIONS: --openssl-legacy-provider - name: Test Curl uses: enflo/curl-action@v1 From 86322864c3570d2a4a99949a3e1ffd02595af068 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 15 Aug 2024 16:51:57 -0700 Subject: [PATCH 23/31] more string futzing --- .github/workflows/ci.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c42f30f..3bed09c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -56,4 +56,5 @@ jobs: - name: Test Curl uses: enflo/curl-action@v1 with: - curl: '-L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.DEPLOY_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/zerotier/${{ secrets.INFRA_REPO_NAME }}/dispatches -d "{\\"event_type\\": \\"deploy_docs_dev\\", \\"client_payload\\": {\\"docker_tag\\": \\"${{ github.sha }}\\"}}"' \ No newline at end of file + curl: | + -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.DEPLOY_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/zerotier/${{ secrets.INFRA_REPO_NAME }}/dispatches -d '{"event_type": "deploy_docs_dev", "client_payload": {"docker_tag": "${{ github.sha }}"}}' \ No newline at end of file From 032b0ec574fbb02efcf4ea810949e2c45610606b Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 15 Aug 2024 16:56:41 -0700 Subject: [PATCH 24/31] another curl --- .github/workflows/ci.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3bed09c..f4efb9d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -53,8 +53,10 @@ jobs: # env: # NODE_OPTIONS: --openssl-legacy-provider + - name: Setup Curl + uses: kordlib/setup-curl@v1 + - name: Test Curl - uses: enflo/curl-action@v1 - with: - curl: | - -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.DEPLOY_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/zerotier/${{ secrets.INFRA_REPO_NAME }}/dispatches -d '{"event_type": "deploy_docs_dev", "client_payload": {"docker_tag": "${{ github.sha }}"}}' \ No newline at end of file + run: | + curl -s -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.DEPLOY_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/zerotier/${{ secrets.INFRA_REPO_NAME }}/dispatches -d '{"event_type": "deploy_docs_dev", "client_payload": {"docker_tag": "${{ github.sha }}"}}' + \ No newline at end of file From 60ab48696303d59540eca8d70b5060674c17a7d7 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 15 Aug 2024 17:00:24 -0700 Subject: [PATCH 25/31] ... --- .github/workflows/ci.yaml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f4efb9d..886a5f8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -53,10 +53,9 @@ jobs: # env: # NODE_OPTIONS: --openssl-legacy-provider - - name: Setup Curl - uses: kordlib/setup-curl@v1 - - name: Test Curl - run: | - curl -s -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.DEPLOY_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/zerotier/${{ secrets.INFRA_REPO_NAME }}/dispatches -d '{"event_type": "deploy_docs_dev", "client_payload": {"docker_tag": "${{ github.sha }}"}}' + uses: thinkdolabs/curl@v1 + with: + args: | + curl -s -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.DEPLOY_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/zerotier/${{ secrets.INFRA_REPO_NAME }}/dispatches -d '{"event_type": "deploy_docs_dev", "client_payload": {"docker_tag": "${{ github.sha }}"}}' \ No newline at end of file From 60b81e346b1bdf8a039460acd33af4096fd52073 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 15 Aug 2024 17:01:54 -0700 Subject: [PATCH 26/31] ... --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 886a5f8..6191a13 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -57,5 +57,5 @@ jobs: uses: thinkdolabs/curl@v1 with: args: | - curl -s -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.DEPLOY_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/zerotier/${{ secrets.INFRA_REPO_NAME }}/dispatches -d '{"event_type": "deploy_docs_dev", "client_payload": {"docker_tag": "${{ github.sha }}"}}' + -s -L -X POST -H 'Accept: application/vnd.github+json' -H 'Authorization: Bearer ${{ secrets.DEPLOY_TOKEN }}'' -H 'X-GitHub-Api-Version: 2022-11-28' https://api.github.com/repos/zerotier/${{ secrets.INFRA_REPO_NAME }}/dispatches -d '{"event_type": "deploy_docs_dev", "client_payload": {"docker_tag": "${{ github.sha }}"}}' \ No newline at end of file From 07201ff3e8d09d216d0f57088876f026e4d5fc16 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 15 Aug 2024 17:03:29 -0700 Subject: [PATCH 27/31] ... --- .github/workflows/ci.yaml | 2 +- .github/workflows/deploy_dev.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6191a13..62a9a20 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -57,5 +57,5 @@ jobs: uses: thinkdolabs/curl@v1 with: args: | - -s -L -X POST -H 'Accept: application/vnd.github+json' -H 'Authorization: Bearer ${{ secrets.DEPLOY_TOKEN }}'' -H 'X-GitHub-Api-Version: 2022-11-28' https://api.github.com/repos/zerotier/${{ secrets.INFRA_REPO_NAME }}/dispatches -d '{"event_type": "deploy_docs_dev", "client_payload": {"docker_tag": "${{ github.sha }}"}}' + -s -L -X POST -H 'Accept: application/vnd.github+json' -H 'Authorization: Bearer ${{ secrets.DEPLOY_TOKEN }}' -H 'X-GitHub-Api-Version: 2022-11-28' https://api.github.com/repos/zerotier/${{ secrets.INFRA_REPO_NAME }}/dispatches -d '{"event_type": "deploy_docs_dev", "client_payload": {"docker_tag": "${{ github.sha }}"}}' \ No newline at end of file diff --git a/.github/workflows/deploy_dev.yaml b/.github/workflows/deploy_dev.yaml index d445d48..ff54883 100644 --- a/.github/workflows/deploy_dev.yaml +++ b/.github/workflows/deploy_dev.yaml @@ -58,4 +58,4 @@ jobs: run: | gcloud auth configure-docker ${{ secrets.GCLOUD_DOCKER_HOST }} docker build -t ${{ secrets.GCLOUD_DOCKER_HOST }}/${{ secrets.GCLOUD_PROJECT_ID }}/zt-docker/docs-zerotier-com:${{ github.sha }} . --push - \ No newline at end of file + From 767a084d34cb409cf1daddc84c5bd5be6ed5eaca Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 15 Aug 2024 17:11:02 -0700 Subject: [PATCH 28/31] ... --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 62a9a20..fc35dfa 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -54,8 +54,8 @@ jobs: # NODE_OPTIONS: --openssl-legacy-provider - name: Test Curl - uses: thinkdolabs/curl@v1 + uses: enflo/curl-action@v1 with: - args: | + curl: | -s -L -X POST -H 'Accept: application/vnd.github+json' -H 'Authorization: Bearer ${{ secrets.DEPLOY_TOKEN }}' -H 'X-GitHub-Api-Version: 2022-11-28' https://api.github.com/repos/zerotier/${{ secrets.INFRA_REPO_NAME }}/dispatches -d '{"event_type": "deploy_docs_dev", "client_payload": {"docker_tag": "${{ github.sha }}"}}' \ No newline at end of file From bbf974618b02b77f0222efb29de4f123a2ae1fad Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 15 Aug 2024 17:20:08 -0700 Subject: [PATCH 29/31] ... --- .github/workflows/ci.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fc35dfa..07b775c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -54,8 +54,8 @@ jobs: # NODE_OPTIONS: --openssl-legacy-provider - name: Test Curl - uses: enflo/curl-action@v1 - with: - curl: | - -s -L -X POST -H 'Accept: application/vnd.github+json' -H 'Authorization: Bearer ${{ secrets.DEPLOY_TOKEN }}' -H 'X-GitHub-Api-Version: 2022-11-28' https://api.github.com/repos/zerotier/${{ secrets.INFRA_REPO_NAME }}/dispatches -d '{"event_type": "deploy_docs_dev", "client_payload": {"docker_tag": "${{ github.sha }}"}}' + #uses: enflo/curl-action@v1 + run: | + apt-get update && apt-get install -y curl + curl -s -L -X POST -H 'Accept: application/vnd.github+json' -H 'Authorization: Bearer ${{ secrets.DEPLOY_TOKEN }}' -H 'X-GitHub-Api-Version: 2022-11-28' https://api.github.com/repos/zerotier/${{ secrets.INFRA_REPO_NAME }}/dispatches -d '{"event_type": "deploy_docs_dev", "client_payload": {"docker_tag": "${{ github.sha }}"}}' \ No newline at end of file From f25bb1a804a197100ef0469217d56f23e8abdea6 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 15 Aug 2024 17:21:16 -0700 Subject: [PATCH 30/31] ... --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 07b775c..db0fb50 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -56,6 +56,6 @@ jobs: - name: Test Curl #uses: enflo/curl-action@v1 run: | - apt-get update && apt-get install -y curl + sudo apt-get update && sudo apt-get install -y curl curl -s -L -X POST -H 'Accept: application/vnd.github+json' -H 'Authorization: Bearer ${{ secrets.DEPLOY_TOKEN }}' -H 'X-GitHub-Api-Version: 2022-11-28' https://api.github.com/repos/zerotier/${{ secrets.INFRA_REPO_NAME }}/dispatches -d '{"event_type": "deploy_docs_dev", "client_payload": {"docker_tag": "${{ github.sha }}"}}' \ No newline at end of file From fb760cde45ce451433f1c69c2f8908f0826e3114 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 15 Aug 2024 17:24:08 -0700 Subject: [PATCH 31/31] ok. that should finally work --- .github/workflows/ci.yaml | 41 ++++++++++++++----------------- .github/workflows/deploy_dev.yaml | 4 +++ 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index db0fb50..3e34aa2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -34,28 +34,23 @@ jobs: restore-keys: | ${{ runner.os }}-${{ runner.arch }}-yarn-docs- - # - name: Install dependencies - # uses: borales/actions-yarn@v5 - # with: - # cmd: install --immutable - - # - name: Build - # uses: borales/actions-yarn@v5 - # with: - # cmd: build - # env: - # NODE_OPTIONS: --openssl-legacy-provider + - name: Install dependencies + uses: borales/actions-yarn@v5 + with: + cmd: install --immutable + + - name: Build + uses: borales/actions-yarn@v5 + with: + cmd: build + env: + NODE_OPTIONS: --openssl-legacy-provider - # - name: Lint - # uses: borales/actions-yarn@v5 - # with: - # cmd: lint - # env: - # NODE_OPTIONS: --openssl-legacy-provider - - - name: Test Curl - #uses: enflo/curl-action@v1 - run: | - sudo apt-get update && sudo apt-get install -y curl - curl -s -L -X POST -H 'Accept: application/vnd.github+json' -H 'Authorization: Bearer ${{ secrets.DEPLOY_TOKEN }}' -H 'X-GitHub-Api-Version: 2022-11-28' https://api.github.com/repos/zerotier/${{ secrets.INFRA_REPO_NAME }}/dispatches -d '{"event_type": "deploy_docs_dev", "client_payload": {"docker_tag": "${{ github.sha }}"}}' + - name: Lint + uses: borales/actions-yarn@v5 + with: + cmd: lint + env: + NODE_OPTIONS: --openssl-legacy-provider + \ No newline at end of file diff --git a/.github/workflows/deploy_dev.yaml b/.github/workflows/deploy_dev.yaml index ff54883..160c251 100644 --- a/.github/workflows/deploy_dev.yaml +++ b/.github/workflows/deploy_dev.yaml @@ -59,3 +59,7 @@ jobs: gcloud auth configure-docker ${{ secrets.GCLOUD_DOCKER_HOST }} docker build -t ${{ secrets.GCLOUD_DOCKER_HOST }}/${{ secrets.GCLOUD_PROJECT_ID }}/zt-docker/docs-zerotier-com:${{ github.sha }} . --push + - name: Deploy docs-dev + run: | + sudo apt-get update && sudo apt-get install -y curl + curl -s -L -X POST -H 'Accept: application/vnd.github+json' -H 'Authorization: Bearer ${{ secrets.DEPLOY_TOKEN }}' -H 'X-GitHub-Api-Version: 2022-11-28' https://api.github.com/repos/zerotier/${{ secrets.INFRA_REPO_NAME }}/dispatches -d '{"event_type": "deploy_docs_dev", "client_payload": {"docker_tag": "${{ github.sha }}"}}' \ No newline at end of file