From 45a22416e49d9eae7a9deb0f0d89249a5ea4538a Mon Sep 17 00:00:00 2001 From: tom Date: Mon, 28 Oct 2024 11:56:08 +0100 Subject: [PATCH 1/7] Update ENVs list in Blockscout docs when new release is published Fixes #2324 --- .github/workflows/sync-envs-docs.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sync-envs-docs.yaml b/.github/workflows/sync-envs-docs.yaml index 9c3c68a046..266fb6dcbf 100644 --- a/.github/workflows/sync-envs-docs.yaml +++ b/.github/workflows/sync-envs-docs.yaml @@ -13,8 +13,9 @@ jobs: env: API_TOKEN_GITHUB: ${{ secrets.GITHUB_TOKEN }} with: - source-files: 'docs/ENVS.md docs/DEPRECATED_ENVS.md' - destination-username: 'blockscout-bot' - destination-repository: 'blockscout/docs' - destination-directory: 'docs/setup/env-variables/frontend-common-envs' + source-files: './docs/ENVS.md ./docs/DEPRECATED_ENVS.md' + destination-username: 'blockscout' + destination-repository: 'docs' + destination-directory: 'setup/env-variables/frontend-common-envs' + commit-username: 'blockscout-bot' commit-email: 'tom@blockscout.com' From ddc1fc69f3b3b897de3e0eed6c5ad930cc3c268b Mon Sep 17 00:00:00 2001 From: tom Date: Mon, 28 Oct 2024 12:13:04 +0100 Subject: [PATCH 2/7] try to use another workflow --- .github/workflows/sync-envs-docs.yaml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/sync-envs-docs.yaml b/.github/workflows/sync-envs-docs.yaml index 266fb6dcbf..7b248fc453 100644 --- a/.github/workflows/sync-envs-docs.yaml +++ b/.github/workflows/sync-envs-docs.yaml @@ -8,14 +8,18 @@ jobs: name: Run runs-on: ubuntu-latest steps: + - name: Checkout repo + uses: actions/checkout@v4 + - name: Copy files to Blockscout Docs repository - uses: lubu12/copy-files-to-repository@v1 + uses: tom2drum/copy_file_to_another_repo_action@main env: API_TOKEN_GITHUB: ${{ secrets.GITHUB_TOKEN }} with: - source-files: './docs/ENVS.md ./docs/DEPRECATED_ENVS.md' - destination-username: 'blockscout' - destination-repository: 'docs' - destination-directory: 'setup/env-variables/frontend-common-envs' - commit-username: 'blockscout-bot' - commit-email: 'tom@blockscout.com' + source_file: 'docs/ENVS.md' + destination_repo: 'blockscout/docs' + destination_folder: 'setup/env-variables/frontend-common-envs' + destination_branch: 'master' + user_email: 'tom@blockscout.com' + user_name: 'blockscout-bot' + use_rsync: true From 71918f0a7737b1e121b666578523b9aaef16629e Mon Sep 17 00:00:00 2001 From: tom goriunov Date: Tue, 29 Oct 2024 13:40:59 +0100 Subject: [PATCH 3/7] Update sync-envs-docs.yaml --- .github/workflows/sync-envs-docs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-envs-docs.yaml b/.github/workflows/sync-envs-docs.yaml index 7b248fc453..6e8a564c55 100644 --- a/.github/workflows/sync-envs-docs.yaml +++ b/.github/workflows/sync-envs-docs.yaml @@ -20,6 +20,6 @@ jobs: destination_repo: 'blockscout/docs' destination_folder: 'setup/env-variables/frontend-common-envs' destination_branch: 'master' - user_email: 'tom@blockscout.com' + user_email: 'bot@blockscout.com' user_name: 'blockscout-bot' use_rsync: true From ca55274026215b37caf3c747a989659ed503817f Mon Sep 17 00:00:00 2001 From: tom Date: Tue, 29 Oct 2024 16:05:21 +0100 Subject: [PATCH 4/7] change github token --- .github/workflows/sync-envs-docs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-envs-docs.yaml b/.github/workflows/sync-envs-docs.yaml index 6e8a564c55..d12c5ee0b2 100644 --- a/.github/workflows/sync-envs-docs.yaml +++ b/.github/workflows/sync-envs-docs.yaml @@ -14,7 +14,7 @@ jobs: - name: Copy files to Blockscout Docs repository uses: tom2drum/copy_file_to_another_repo_action@main env: - API_TOKEN_GITHUB: ${{ secrets.GITHUB_TOKEN }} + API_TOKEN_GITHUB: ${{ secrets.GITHIB_BOT_TOKEN }} with: source_file: 'docs/ENVS.md' destination_repo: 'blockscout/docs' From 4d6133f5baabfe967a5c9c22626a15169d4894f6 Mon Sep 17 00:00:00 2001 From: tom Date: Tue, 29 Oct 2024 17:58:40 +0100 Subject: [PATCH 5/7] try to copy both files --- .github/workflows/sync-envs-docs.yaml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync-envs-docs.yaml b/.github/workflows/sync-envs-docs.yaml index d12c5ee0b2..816ac56b50 100644 --- a/.github/workflows/sync-envs-docs.yaml +++ b/.github/workflows/sync-envs-docs.yaml @@ -11,8 +11,8 @@ jobs: - name: Checkout repo uses: actions/checkout@v4 - - name: Copy files to Blockscout Docs repository - uses: tom2drum/copy_file_to_another_repo_action@main + - name: Copy main ENV file to Blockscout Docs repository + uses: dmnemec/copy_file_to_another_repo_action@main env: API_TOKEN_GITHUB: ${{ secrets.GITHIB_BOT_TOKEN }} with: @@ -23,3 +23,16 @@ jobs: user_email: 'bot@blockscout.com' user_name: 'blockscout-bot' use_rsync: true + + - name: Copy deprecated ENV file to Blockscout Docs repository + uses: dmnemec/copy_file_to_another_repo_action@main + env: + API_TOKEN_GITHUB: ${{ secrets.GITHIB_BOT_TOKEN }} + with: + source_file: 'docs/DEPRECATED_ENVS.md' + destination_repo: 'blockscout/docs' + destination_folder: 'setup/env-variables/frontend-common-envs' + destination_branch: 'master' + user_email: 'bot@blockscout.com' + user_name: 'blockscout-bot' + use_rsync: true From 10a6c021fa22c237b51c6922d340a91337913d51 Mon Sep 17 00:00:00 2001 From: tom Date: Tue, 29 Oct 2024 18:21:36 +0100 Subject: [PATCH 6/7] integrate to release workflow --- .github/workflows/release.yml | 6 ++++++ .../workflows/{sync-envs-docs.yaml => sync-envs-docs.yml} | 0 2 files changed, 6 insertions(+) rename .github/workflows/{sync-envs-docs.yaml => sync-envs-docs.yml} (100%) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index df2c0433b1..7485ee7c82 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -81,6 +81,12 @@ jobs: with: platforms: linux/amd64,linux/arm64/v8 + sync_envs_docs: + name: Sync ENV variables docs + uses: './.github/workflows/sync-envs-docs.yml' + needs: publish_image + secrets: inherit + # Temporary disable this step because it is broken # There is an issue with building web3modal deps upload_source_maps: diff --git a/.github/workflows/sync-envs-docs.yaml b/.github/workflows/sync-envs-docs.yml similarity index 100% rename from .github/workflows/sync-envs-docs.yaml rename to .github/workflows/sync-envs-docs.yml From fb75e2b73bacde9db78fdf5a4ebd4c5932d703d0 Mon Sep 17 00:00:00 2001 From: tom Date: Wed, 30 Oct 2024 10:47:41 +0100 Subject: [PATCH 7/7] [skip ci] rename files while copying --- .github/workflows/sync-envs-docs.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/sync-envs-docs.yml b/.github/workflows/sync-envs-docs.yml index 816ac56b50..4e034dd9eb 100644 --- a/.github/workflows/sync-envs-docs.yml +++ b/.github/workflows/sync-envs-docs.yml @@ -19,6 +19,7 @@ jobs: source_file: 'docs/ENVS.md' destination_repo: 'blockscout/docs' destination_folder: 'setup/env-variables/frontend-common-envs' + rename: 'envs.md' destination_branch: 'master' user_email: 'bot@blockscout.com' user_name: 'blockscout-bot' @@ -32,6 +33,7 @@ jobs: source_file: 'docs/DEPRECATED_ENVS.md' destination_repo: 'blockscout/docs' destination_folder: 'setup/env-variables/frontend-common-envs' + rename: 'deprecated-envs.md' destination_branch: 'master' user_email: 'bot@blockscout.com' user_name: 'blockscout-bot'