From bc7b5aee58af16aa7dd2742c8e007b892da82410 Mon Sep 17 00:00:00 2001 From: Charles Bochet Date: Wed, 8 Apr 2026 15:25:51 +0200 Subject: [PATCH] chore: centralize deploy/install CD actions in twentyhq/twenty (#19454) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary - Adds `deploy-twenty-app` and `install-twenty-app` composite actions to `.github/actions/` so app repos can reference them remotely — same pattern as `spawn-twenty-app-dev-test` for CI - Updates `cd.yml` in template, hello-world, and postcard to use `twentyhq/twenty/.github/actions/deploy-twenty-app@main` / `install-twenty-app@main` instead of local `./.github/actions/` copies - Removes the 6 local action files that were duplicated across template and example apps **Before** (each app repo carried its own action copies): ```yaml uses: ./.github/actions/deploy ``` **After** (centralized, like CI): ```yaml uses: twentyhq/twenty/.github/actions/deploy-twenty-app@main ``` Made with [Cursor](https://cursor.com) --- .../actions/deploy-twenty-app}/action.yml | 0 .../actions/install-twenty-app}/action.yml | 0 .../template/github/workflows/cd.yml | 4 +- .../.github/actions/deploy/action.yml | 46 ------------------- .../.github/actions/install/action.yml | 46 ------------------- .../hello-world/.github/workflows/cd.yml | 4 +- .../.github/actions/deploy/action.yml | 46 ------------------- .../.github/actions/install/action.yml | 46 ------------------- .../postcard/.github/workflows/cd.yml | 4 +- 9 files changed, 6 insertions(+), 190 deletions(-) rename {packages/create-twenty-app/src/constants/template/github/actions/deploy => .github/actions/deploy-twenty-app}/action.yml (100%) rename {packages/create-twenty-app/src/constants/template/github/actions/install => .github/actions/install-twenty-app}/action.yml (100%) delete mode 100644 packages/twenty-apps/examples/hello-world/.github/actions/deploy/action.yml delete mode 100644 packages/twenty-apps/examples/hello-world/.github/actions/install/action.yml delete mode 100644 packages/twenty-apps/examples/postcard/.github/actions/deploy/action.yml delete mode 100644 packages/twenty-apps/examples/postcard/.github/actions/install/action.yml diff --git a/packages/create-twenty-app/src/constants/template/github/actions/deploy/action.yml b/.github/actions/deploy-twenty-app/action.yml similarity index 100% rename from packages/create-twenty-app/src/constants/template/github/actions/deploy/action.yml rename to .github/actions/deploy-twenty-app/action.yml diff --git a/packages/create-twenty-app/src/constants/template/github/actions/install/action.yml b/.github/actions/install-twenty-app/action.yml similarity index 100% rename from packages/create-twenty-app/src/constants/template/github/actions/install/action.yml rename to .github/actions/install-twenty-app/action.yml diff --git a/packages/create-twenty-app/src/constants/template/github/workflows/cd.yml b/packages/create-twenty-app/src/constants/template/github/workflows/cd.yml index 909916ed063..61cbcfd7ab8 100644 --- a/packages/create-twenty-app/src/constants/template/github/workflows/cd.yml +++ b/packages/create-twenty-app/src/constants/template/github/workflows/cd.yml @@ -30,13 +30,13 @@ jobs: ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Deploy - uses: ./.github/actions/deploy + uses: twentyhq/twenty/.github/actions/deploy-twenty-app@main with: api-url: ${{ env.TWENTY_DEPLOY_URL }} api-key: ${{ secrets.TWENTY_DEPLOY_API_KEY }} - name: Install - uses: ./.github/actions/install + uses: twentyhq/twenty/.github/actions/install-twenty-app@main with: api-url: ${{ env.TWENTY_DEPLOY_URL }} api-key: ${{ secrets.TWENTY_DEPLOY_API_KEY }} diff --git a/packages/twenty-apps/examples/hello-world/.github/actions/deploy/action.yml b/packages/twenty-apps/examples/hello-world/.github/actions/deploy/action.yml deleted file mode 100644 index 371d202f2e6..00000000000 --- a/packages/twenty-apps/examples/hello-world/.github/actions/deploy/action.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Deploy Twenty App -description: Build and deploy a Twenty app to a remote instance - -inputs: - api-url: - description: Base URL of the target Twenty instance (e.g. https://my.twenty.instance) - required: true - api-key: - description: API key or access token for the target instance - required: true - -runs: - using: composite - steps: - - name: Enable Corepack - shell: bash - run: corepack enable - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - cache: yarn - - - name: Install dependencies - shell: bash - run: yarn install --immutable - - - name: Configure remote - shell: bash - run: | - mkdir -p ~/.twenty - node -e " - const fs = require('fs'), path = require('path'), os = require('os'); - fs.writeFileSync(path.join(os.homedir(), '.twenty', 'config.json'), JSON.stringify({ - version: 1, - remotes: { target: { apiUrl: process.env.API_URL, apiKey: process.env.API_KEY } } - }, null, 2)); - " - env: - API_URL: ${{ inputs.api-url }} - API_KEY: ${{ inputs.api-key }} - - - name: Deploy - shell: bash - run: yarn twenty deploy --remote target diff --git a/packages/twenty-apps/examples/hello-world/.github/actions/install/action.yml b/packages/twenty-apps/examples/hello-world/.github/actions/install/action.yml deleted file mode 100644 index 3f7ef535cfa..00000000000 --- a/packages/twenty-apps/examples/hello-world/.github/actions/install/action.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Install Twenty App -description: Install (or upgrade) a Twenty app on a specific workspace - -inputs: - api-url: - description: Base URL of the target Twenty instance (e.g. https://my.twenty.instance) - required: true - api-key: - description: API key or access token for the target workspace - required: true - -runs: - using: composite - steps: - - name: Enable Corepack - shell: bash - run: corepack enable - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - cache: yarn - - - name: Install dependencies - shell: bash - run: yarn install --immutable - - - name: Configure remote - shell: bash - run: | - mkdir -p ~/.twenty - node -e " - const fs = require('fs'), path = require('path'), os = require('os'); - fs.writeFileSync(path.join(os.homedir(), '.twenty', 'config.json'), JSON.stringify({ - version: 1, - remotes: { target: { apiUrl: process.env.API_URL, apiKey: process.env.API_KEY } } - }, null, 2)); - " - env: - API_URL: ${{ inputs.api-url }} - API_KEY: ${{ inputs.api-key }} - - - name: Install - shell: bash - run: yarn twenty install --remote target diff --git a/packages/twenty-apps/examples/hello-world/.github/workflows/cd.yml b/packages/twenty-apps/examples/hello-world/.github/workflows/cd.yml index 909916ed063..61cbcfd7ab8 100644 --- a/packages/twenty-apps/examples/hello-world/.github/workflows/cd.yml +++ b/packages/twenty-apps/examples/hello-world/.github/workflows/cd.yml @@ -30,13 +30,13 @@ jobs: ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Deploy - uses: ./.github/actions/deploy + uses: twentyhq/twenty/.github/actions/deploy-twenty-app@main with: api-url: ${{ env.TWENTY_DEPLOY_URL }} api-key: ${{ secrets.TWENTY_DEPLOY_API_KEY }} - name: Install - uses: ./.github/actions/install + uses: twentyhq/twenty/.github/actions/install-twenty-app@main with: api-url: ${{ env.TWENTY_DEPLOY_URL }} api-key: ${{ secrets.TWENTY_DEPLOY_API_KEY }} diff --git a/packages/twenty-apps/examples/postcard/.github/actions/deploy/action.yml b/packages/twenty-apps/examples/postcard/.github/actions/deploy/action.yml deleted file mode 100644 index 371d202f2e6..00000000000 --- a/packages/twenty-apps/examples/postcard/.github/actions/deploy/action.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Deploy Twenty App -description: Build and deploy a Twenty app to a remote instance - -inputs: - api-url: - description: Base URL of the target Twenty instance (e.g. https://my.twenty.instance) - required: true - api-key: - description: API key or access token for the target instance - required: true - -runs: - using: composite - steps: - - name: Enable Corepack - shell: bash - run: corepack enable - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - cache: yarn - - - name: Install dependencies - shell: bash - run: yarn install --immutable - - - name: Configure remote - shell: bash - run: | - mkdir -p ~/.twenty - node -e " - const fs = require('fs'), path = require('path'), os = require('os'); - fs.writeFileSync(path.join(os.homedir(), '.twenty', 'config.json'), JSON.stringify({ - version: 1, - remotes: { target: { apiUrl: process.env.API_URL, apiKey: process.env.API_KEY } } - }, null, 2)); - " - env: - API_URL: ${{ inputs.api-url }} - API_KEY: ${{ inputs.api-key }} - - - name: Deploy - shell: bash - run: yarn twenty deploy --remote target diff --git a/packages/twenty-apps/examples/postcard/.github/actions/install/action.yml b/packages/twenty-apps/examples/postcard/.github/actions/install/action.yml deleted file mode 100644 index 3f7ef535cfa..00000000000 --- a/packages/twenty-apps/examples/postcard/.github/actions/install/action.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Install Twenty App -description: Install (or upgrade) a Twenty app on a specific workspace - -inputs: - api-url: - description: Base URL of the target Twenty instance (e.g. https://my.twenty.instance) - required: true - api-key: - description: API key or access token for the target workspace - required: true - -runs: - using: composite - steps: - - name: Enable Corepack - shell: bash - run: corepack enable - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - cache: yarn - - - name: Install dependencies - shell: bash - run: yarn install --immutable - - - name: Configure remote - shell: bash - run: | - mkdir -p ~/.twenty - node -e " - const fs = require('fs'), path = require('path'), os = require('os'); - fs.writeFileSync(path.join(os.homedir(), '.twenty', 'config.json'), JSON.stringify({ - version: 1, - remotes: { target: { apiUrl: process.env.API_URL, apiKey: process.env.API_KEY } } - }, null, 2)); - " - env: - API_URL: ${{ inputs.api-url }} - API_KEY: ${{ inputs.api-key }} - - - name: Install - shell: bash - run: yarn twenty install --remote target diff --git a/packages/twenty-apps/examples/postcard/.github/workflows/cd.yml b/packages/twenty-apps/examples/postcard/.github/workflows/cd.yml index 909916ed063..61cbcfd7ab8 100644 --- a/packages/twenty-apps/examples/postcard/.github/workflows/cd.yml +++ b/packages/twenty-apps/examples/postcard/.github/workflows/cd.yml @@ -30,13 +30,13 @@ jobs: ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Deploy - uses: ./.github/actions/deploy + uses: twentyhq/twenty/.github/actions/deploy-twenty-app@main with: api-url: ${{ env.TWENTY_DEPLOY_URL }} api-key: ${{ secrets.TWENTY_DEPLOY_API_KEY }} - name: Install - uses: ./.github/actions/install + uses: twentyhq/twenty/.github/actions/install-twenty-app@main with: api-url: ${{ env.TWENTY_DEPLOY_URL }} api-key: ${{ secrets.TWENTY_DEPLOY_API_KEY }}