From 26e4cbe81c6e6baac2a4ea8a8561ffb26a415b20 Mon Sep 17 00:00:00 2001 From: ivan-aksamentov Date: Fri, 1 Sep 2023 22:32:40 +0200 Subject: [PATCH 1/5] chore(ci): prevent ci loops --- scripts/rebuild_v3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/rebuild_v3 b/scripts/rebuild_v3 index 14e9d1b6d..1ffa943ab 100755 --- a/scripts/rebuild_v3 +++ b/scripts/rebuild_v3 @@ -285,7 +285,7 @@ def aggregate_release_notes(release_infos): def commit_changes(args, tag, release_infos): l.info(f"Commiting changes for '{tag}'") - commit_message = "chore: rebuild" + commit_message = "chore: rebuild [skip ci]" if args.release: dataset_names = format_list( unique([get_dataset_name(release_info["dataset"]) for release_info in release_infos]), From 6c2d1b90836be80d9561a4e581be6895fd437903 Mon Sep 17 00:00:00 2001 From: nextstrain-bot Date: Fri, 1 Sep 2023 20:34:26 +0000 Subject: [PATCH 2/5] chore: rebuild [skip ci] --- data_output/index.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data_output/index.json b/data_output/index.json index 94fee2061..a0c6369bf 100644 --- a/data_output/index.json +++ b/data_output/index.json @@ -1,6 +1,6 @@ { "schemaVersion": "3.0.0", - "updatedAt": "2023-08-31T11:28:52Z", + "updatedAt": "2023-09-01T20:34:20Z", "collections": [ { "meta": { From 8d7da2369b439b7c721b4e2f3f897769cfc49c4a Mon Sep 17 00:00:00 2001 From: ivan-aksamentov Date: Fri, 1 Sep 2023 22:36:44 +0200 Subject: [PATCH 3/5] chore(ci): avoid duplicated ci runs on push and pull_request events --- .github/workflows/build-and-deploy.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index c97c027ae..35621986d 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -1,5 +1,9 @@ on: push: + branches: + - master + - staging + - release pull_request: repository_dispatch: types: build-and-deploy From a48c57f992ea5d514f51a600cb03a6772b5f9f2a Mon Sep 17 00:00:00 2001 From: nextstrain-bot Date: Fri, 1 Sep 2023 20:39:23 +0000 Subject: [PATCH 4/5] chore: rebuild [skip ci] --- data_output/index.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data_output/index.json b/data_output/index.json index a0c6369bf..a5e6c5515 100644 --- a/data_output/index.json +++ b/data_output/index.json @@ -1,6 +1,6 @@ { "schemaVersion": "3.0.0", - "updatedAt": "2023-09-01T20:34:20Z", + "updatedAt": "2023-09-01T20:39:16Z", "collections": [ { "meta": { From ae96eb6a9a9d5d901a71079cceb2d747db5ef955 Mon Sep 17 00:00:00 2001 From: ivan-aksamentov Date: Mon, 4 Sep 2023 15:06:14 +0200 Subject: [PATCH 5/5] chore(ci): ensure a branch is checked out even in pull_request runs --- .github/workflows/build-and-deploy.yml | 37 ++++++++++++++++---------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 35621986d..237f0f237 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -42,22 +42,9 @@ jobs: - name: "Checkout code" uses: actions/checkout@v3 with: - fetch-depth: 50 + fetch-depth: 0 submodules: true - - name: "Install system dependencies" - run: | - sudo apt-get install brotli pigz parallel rename --yes -qq >/dev/null - - - name: "Install awscli" - run: | - pushd /tmp >/dev/null - curl -fsSL "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" - unzip -oqq awscliv2.zip - sudo ./aws/install --update - popd >/dev/null - aws --version - - name: "Authenticate git" run: | export GITHUB_TOKEN="${{ secrets.GH_TOKEN_NEXTSTRAIN_BOT_REPO }}" @@ -73,6 +60,28 @@ jobs: gh auth setup-git >/dev/null + - name: "Extract branch name" + run: | + echo "current_branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + id: branch-name + + - name: "Checkout branch" + run: | + git checkout ${{ steps.branch-name.outputs.current_branch }} + + - name: "Install system dependencies" + run: | + sudo apt-get install brotli pigz parallel rename --yes -qq >/dev/null + + - name: "Install awscli" + run: | + pushd /tmp >/dev/null + curl -fsSL "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" + unzip -oqq awscliv2.zip + sudo ./aws/install --update + popd >/dev/null + aws --version + - name: "Rebuild, commit and push datasets" if: github.ref != 'refs/heads/release' run: |