## Summary - Adds reusable composite GitHub Actions for Twenty app deployment: - `.github/actions/deploy` — builds and deploys to a remote instance (`api-url`, `api-key` inputs) - `.github/actions/install` — installs/upgrades on a specific workspace (`api-url`, `api-key` inputs) - Adds a `cd.yml` CD workflow that calls both actions in sequence. The workflow: - Deploys on push to `main` - Can be triggered from a PR by adding a `deploy` label - Configures a named remote via `TWENTY_DEPLOY_URL` env var and `TWENTY_DEPLOY_API_KEY` secret - Applied to: `create-twenty-app` template, `postcard` example, `hello-world` example - Updates the `spawn-twenty-app-dev-test` action ref from `@feature/sdk-config-file-source-of-truth` to `@main` in all `ci.yml` files
43 lines
937 B
YAML
43 lines
937 B
YAML
name: CD
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
types: [labeled]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
TWENTY_DEPLOY_URL: http://localhost:3000
|
|
|
|
concurrency:
|
|
group: cd-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
deploy-and-install:
|
|
if: >-
|
|
github.event_name == 'push' ||
|
|
(github.event_name == 'pull_request' && github.event.label.name == 'deploy')
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha || github.sha }}
|
|
|
|
- name: Deploy
|
|
uses: ./.github/actions/deploy
|
|
with:
|
|
api-url: ${{ env.TWENTY_DEPLOY_URL }}
|
|
api-key: ${{ secrets.TWENTY_DEPLOY_API_KEY }}
|
|
|
|
- name: Install
|
|
uses: ./.github/actions/install
|
|
with:
|
|
api-url: ${{ env.TWENTY_DEPLOY_URL }}
|
|
api-key: ${{ secrets.TWENTY_DEPLOY_API_KEY }}
|