The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
chore: centralize deploy/install CD actions in twentyhq/twenty (#19454)
Charles Bochetbc7b5aee58af
diff --git a/packages/create-twenty-app/src/constants/template/github/actions/deploy/action.yml b/.github/actions/deploy-twenty-app/action.ymlsimilarity index 100%rename from packages/create-twenty-app/src/constants/template/github/actions/deploy/action.ymlrename to .github/actions/deploy-twenty-app/action.ymldiff --git a/packages/create-twenty-app/src/constants/template/github/actions/install/action.yml b/.github/actions/install-twenty-app/action.ymlsimilarity index 100%rename from packages/create-twenty-app/src/constants/template/github/actions/install/action.ymlrename to .github/actions/install-twenty-app/action.ymldiff --git a/packages/create-twenty-app/src/constants/template/github/workflows/cd.yml b/packages/create-twenty-app/src/constants/template/github/workflows/cd.ymlindex 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@mainwith: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@mainwith: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.ymldeleted file mode 100644index 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 targetdiff --git a/packages/twenty-apps/examples/hello-world/.github/actions/install/action.yml b/packages/twenty-apps/examples/hello-world/.github/actions/install/action.ymldeleted file mode 100644index 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 targetdiff --git a/packages/twenty-apps/examples/hello-world/.github/workflows/cd.yml b/packages/twenty-apps/examples/hello-world/.github/workflows/cd.ymlindex 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@mainwith: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@mainwith: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.ymldeleted file mode 100644index 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 targetdiff --git a/packages/twenty-apps/examples/postcard/.github/actions/install/action.yml b/packages/twenty-apps/examples/postcard/.github/actions/install/action.ymldeleted file mode 100644index 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 targetdiff --git a/packages/twenty-apps/examples/postcard/.github/workflows/cd.yml b/packages/twenty-apps/examples/postcard/.github/workflows/cd.ymlindex 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@mainwith: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@mainwith:api-url: ${{ env.TWENTY_DEPLOY_URL }}api-key: ${{ secrets.TWENTY_DEPLOY_API_KEY }}