From c462b072243c4fb8fc831773ce68c622ba4012a4 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 20 Oct 2023 10:34:38 +0200 Subject: [PATCH 1/8] Create deploy qa workflow --- .github/workflows/deploy-qa.yml | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/deploy-qa.yml diff --git a/.github/workflows/deploy-qa.yml b/.github/workflows/deploy-qa.yml new file mode 100644 index 0000000000..9fa8a0cd3f --- /dev/null +++ b/.github/workflows/deploy-qa.yml @@ -0,0 +1,35 @@ +name: Deploy QA + +on: + push: + branches: + - master + workflow_dispatch: + +env: + BRANCH: ${{ github.event.pull_request.head.ref }} + BASE_BRANCH: ${{ github.event.pull_request.base.ref}} + PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + NX_BASE_BRANCH: origin/${{ github.base_ref }} + USE_NX_AFFECTED: ${{ github.event_name == 'pull_request' && github.base_ref != 'master'}} + NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} + +jobs: + trigger-deploy-to-qa-env: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Get the current budibase release version + id: version + run: | + release_version=$(cat lerna.json | jq -r '.version') + echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV + + - uses: passeidireto/trigger-external-workflow-action@main + env: + PAYLOAD_VERSION: ${{ github.sha }} + REF_NAME: ${{ github.ref_name}} + with: + repository: budibase/budibase-deploys + event: budicloud-qa-deploy + github_pat: ${{ secrets.GH_ACCESS_TOKEN }} From ec76388de4a1093bdd9a00e64b280cac491c937a Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 20 Oct 2023 10:37:22 +0200 Subject: [PATCH 2/8] Use event v2 --- .github/workflows/deploy-qa.yml | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/.github/workflows/deploy-qa.yml b/.github/workflows/deploy-qa.yml index 9fa8a0cd3f..97a662d2f8 100644 --- a/.github/workflows/deploy-qa.yml +++ b/.github/workflows/deploy-qa.yml @@ -6,30 +6,15 @@ on: - master workflow_dispatch: -env: - BRANCH: ${{ github.event.pull_request.head.ref }} - BASE_BRANCH: ${{ github.event.pull_request.base.ref}} - PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - NX_BASE_BRANCH: origin/${{ github.base_ref }} - USE_NX_AFFECTED: ${{ github.event_name == 'pull_request' && github.base_ref != 'master'}} - NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} - jobs: trigger-deploy-to-qa-env: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Get the current budibase release version - id: version - run: | - release_version=$(cat lerna.json | jq -r '.version') - echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV - - - uses: passeidireto/trigger-external-workflow-action@main + - uses: peter-evans/repository-dispatch@v2 env: PAYLOAD_VERSION: ${{ github.sha }} REF_NAME: ${{ github.ref_name}} with: repository: budibase/budibase-deploys - event: budicloud-qa-deploy - github_pat: ${{ secrets.GH_ACCESS_TOKEN }} + event-type: budicloud-qa-deploy-v2 + token: ${{ secrets.GH_ACCESS_TOKEN }} From d9e9f369858fe11c92f4b52c9c07bf10488da56e Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 20 Oct 2023 10:38:01 +0200 Subject: [PATCH 3/8] test --- .github/workflows/deploy-qa.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy-qa.yml b/.github/workflows/deploy-qa.yml index 97a662d2f8..3cbe366f08 100644 --- a/.github/workflows/deploy-qa.yml +++ b/.github/workflows/deploy-qa.yml @@ -4,6 +4,7 @@ on: push: branches: - master + - BUDI-7641/remove-npm-from-apps-worker-docker workflow_dispatch: jobs: From c5b37ae0c73c9b42ec682c8fdbb5791d3a232163 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 20 Oct 2023 10:42:45 +0200 Subject: [PATCH 4/8] Push --- .github/workflows/deploy-qa.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-qa.yml b/.github/workflows/deploy-qa.yml index 3cbe366f08..74b06faefe 100644 --- a/.github/workflows/deploy-qa.yml +++ b/.github/workflows/deploy-qa.yml @@ -3,8 +3,8 @@ name: Deploy QA on: push: branches: - - master - BUDI-7641/remove-npm-from-apps-worker-docker + - master workflow_dispatch: jobs: From 65fea6d680038e52c422076737cf4bdbbc36effd Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 20 Oct 2023 10:44:24 +0200 Subject: [PATCH 5/8] Fix branch name --- .github/workflows/deploy-qa.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-qa.yml b/.github/workflows/deploy-qa.yml index 74b06faefe..d4bbb1c36a 100644 --- a/.github/workflows/deploy-qa.yml +++ b/.github/workflows/deploy-qa.yml @@ -3,8 +3,8 @@ name: Deploy QA on: push: branches: - - BUDI-7641/remove-npm-from-apps-worker-docker - master + - BUDI-7641/push_v2_images_to_qa workflow_dispatch: jobs: From e701bd2b89153ff446e943c265bfdbb65917b84d Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 20 Oct 2023 12:38:52 +0200 Subject: [PATCH 6/8] Ref name in master --- .github/workflows/deploy-qa.yml | 2 +- .github/workflows/release-master.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-qa.yml b/.github/workflows/deploy-qa.yml index d4bbb1c36a..a3fff65f35 100644 --- a/.github/workflows/deploy-qa.yml +++ b/.github/workflows/deploy-qa.yml @@ -17,5 +17,5 @@ jobs: REF_NAME: ${{ github.ref_name}} with: repository: budibase/budibase-deploys - event-type: budicloud-qa-deploy-v2 + event-type: budicloud-qa-deploy token: ${{ secrets.GH_ACCESS_TOKEN }} diff --git a/.github/workflows/release-master.yml b/.github/workflows/release-master.yml index 4acd5088d2..9ab8530341 100644 --- a/.github/workflows/release-master.yml +++ b/.github/workflows/release-master.yml @@ -123,6 +123,7 @@ jobs: - uses: passeidireto/trigger-external-workflow-action@main env: PAYLOAD_VERSION: ${{ env.RELEASE_VERSION }} + REF_NAME: ${{ github.ref_name}} with: repository: budibase/budibase-deploys event: budicloud-qa-deploy From 1478ef503ade59f2aa172ec1c3a059019ee97e6a Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 20 Oct 2023 13:31:50 +0200 Subject: [PATCH 7/8] Don't use nx cloud locally --- nx.json | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nx.json b/nx.json index fef6893f9d..618395ec90 100644 --- a/nx.json +++ b/nx.json @@ -3,14 +3,16 @@ "default": { "runner": "nx-cloud", "options": { - "cacheableOperations": ["build", "test", "check:types"], - "accessToken": "MmM4OGYxNzItMDBlYy00ZmE3LTk4MTYtNmJhYWMyZjBjZTUyfHJlYWQ=" + "cacheableOperations": ["build", "test", "check:types"] } } }, "targetDefaults": { "build": { - "inputs": ["{workspaceRoot}/scripts/build.js"] + "inputs": [ + "{workspaceRoot}/scripts/build.js", + "{workspaceRoot}/lerna.json" + ] } } } From 1b3ba9a4022b0a2a0d4767d63d68b075575d8634 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 20 Oct 2023 13:32:54 +0200 Subject: [PATCH 8/8] Don't use nx cloud on ci --- .github/workflows/budibase_ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index 1580be338e..c73d013b78 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -19,7 +19,6 @@ env: PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} NX_BASE_BRANCH: origin/${{ github.base_ref }} USE_NX_AFFECTED: ${{ github.event_name == 'pull_request' && github.base_ref != 'master'}} - NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} jobs: lint: