Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
should_build_and_publish: ${{ steps.setflag.outputs.should_build_and_publish }}
should_trigger_saas: ${{ steps.setflag.outputs.should_trigger_saas }}
steps:
- id: setflag
shell: bash
Expand All @@ -40,6 +41,12 @@ jobs:
echo "should_build_and_publish=false" >> "$GITHUB_OUTPUT"
fi

if [[ -n "${{ secrets.GITLAB_SAAS_PAT }}" ]]; then
echo "should_trigger_saas=true" >> "$GITHUB_OUTPUT"
else
echo "should_trigger_saas=false" >> "$GITHUB_OUTPUT"
fi

# ==========================================================================
# BUILD STAGE - Build Docker images for backend and frontend
# ==========================================================================
Expand Down Expand Up @@ -1104,3 +1111,78 @@ jobs:
TARGET=${{ env.RELEASE_DOCKER_REPOSITORY }}/cloudron:develop-latest
echo "Publishing $SOURCE → $TARGET"
docker buildx imagetools create -t $TARGET $SOURCE

trigger-saas-build:
name: Trigger SaaS GitLab Pipeline
runs-on: ubuntu-latest
needs:
- build-final-backend
- build-final-web-frontend
- build-final-all-in-one
- check-build-and-publish
if: needs.check-build-and-publish.outputs.should_build_and_publish == 'true' && needs.check-build-and-publish.outputs.should_trigger_saas == 'true' && github.ref_name == 'develop'
env:
GITLAB_SAAS_PAT: ${{ secrets.GITLAB_SAAS_PAT }}
GIT_USER_NAME: "Baserow CI"
GIT_USER_EMAIL: "ci@baserow.io"
steps:
- name: Checkout core repo
uses: actions/checkout@v4

- name: Clone SaaS repository from GitLab
run: |
echo "🔄 Cloning baserow-saas..."
git clone -b develop https://oauth2:${GITLAB_SAAS_PAT}@gitlab.com/baserow/baserow-saas.git saas
cd saas

- name: Update image version files
working-directory: saas
run: |
echo "🧩 Generating updated image references..."

BACKEND_IMAGE="${{ env.REGISTRY }}/${{ env.IMAGE_REPO }}/backend:ci-tested-${{ github.sha }}"
BACKEND_DEV_IMAGE="${{ env.REGISTRY }}/${{ env.IMAGE_REPO }}/backend_dev:ci-${{ github.sha }}"
WEB_IMAGE="${{ env.REGISTRY }}/${{ env.IMAGE_REPO }}/web-frontend:ci-tested-${{ github.sha }}"
WEB_DEV_IMAGE="${{ env.REGISTRY }}/${{ env.IMAGE_REPO }}/web-frontend_dev:ci-${{ github.sha }}"
ALL_IN_ONE_IMAGE="${{ env.REGISTRY }}/${{ env.IMAGE_REPO }}/baserow:ci-tested-${{ github.sha }}"

echo "$BACKEND_IMAGE" > plugins/saas/backend/build_from_image.version
echo "$BACKEND_DEV_IMAGE" > plugins/saas/backend/build_from_dev_image.version
echo "$WEB_IMAGE" > plugins/saas/web-frontend/build_from_image.version
echo "$WEB_DEV_IMAGE" > plugins/saas/web-frontend/build_from_dev_image.version
echo "$ALL_IN_ONE_IMAGE" > all_in_one_image.version

echo "✅ Updated image references:"
cat plugins/saas/backend/build_from_image.version
cat plugins/saas/web-frontend/build_from_image.version
cat all_in_one_image.version

- name: Commit and push changes to GitLab
working-directory: saas
run: |
echo "📝 Committing and pushing changes to GitLab..."

git config user.name "${GIT_USER_NAME}"
git config user.email "${GIT_USER_EMAIL}"

git add \
plugins/saas/backend/build_from_image.version \
plugins/saas/backend/build_from_dev_image.version \
plugins/saas/web-frontend/build_from_image.version \
plugins/saas/web-frontend/build_from_dev_image.version \
all_in_one_image.version

if git diff-index --quiet HEAD --; then
echo "No changes detected — skipping commit."
exit 0
fi

COMMIT_MSG="Automatic core image bump:
- backend: ${BACKEND_IMAGE}
- web-frontend: ${WEB_IMAGE}
- all-in-one: ${ALL_IN_ONE_IMAGE}"

git commit -m "$COMMIT_MSG"
git push origin develop

echo "✅ Successfully pushed updates to baserow-saas."
Loading