An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
ci(build): use rolling tags for main image builds
Andras Bacsai09af3e065ab6
diff --git a/.github/workflows/coolify-sha-build.yml b/.github/workflows/coolify-main-build.ymlsimilarity index 82%rename from .github/workflows/coolify-sha-build.ymlrename to .github/workflows/coolify-main-build.ymlindex 595fbbd93d..2ab48a4825 100644--- a/.github/workflows/coolify-sha-build.yml+++ b/.github/workflows/coolify-main-build.yml@@ -1,4 +1,4 @@-name: Build Coolify (SHA)+name: Build Coolify Mainon:push:@@ -8,6 +8,10 @@ permissions:contents: readpackages: write+concurrency:+ group: coolify-main-build+ cancel-in-progress: false+env:GITHUB_REGISTRY: ghcr.ioDOCKER_REGISTRY: docker.io@@ -62,9 +66,11 @@ jobs:push: truebuild-args: |COOLIFY_VERSION=${{ steps.version.outputs.version }}+ labels: |+ org.opencontainers.image.revision=${{ github.sha }}tags: |- ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:sha-${{ steps.version.outputs.short_sha }}-${{ matrix.arch }}- ${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:sha-${{ steps.version.outputs.short_sha }}-${{ matrix.arch }}+ ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:main-${{ matrix.arch }}+ ${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:main-${{ matrix.arch }}merge-manifest:runs-on: ubuntu-24.04@@ -93,9 +99,10 @@ jobs:run: |IMAGE="${REGISTRY}/${IMAGE_NAME}"docker buildx imagetools create \- "${IMAGE}:sha-${SHA}-amd64" \- "${IMAGE}:sha-${SHA}-aarch64" \- --tag "${IMAGE}:sha-${SHA}"+ "${IMAGE}:main-amd64" \+ "${IMAGE}:main-aarch64" \+ --tag "${IMAGE}:sha-${SHA}" \+ --tag "${IMAGE}:main"- name: Create & publish manifest on ${{ env.DOCKER_REGISTRY }}env:@@ -104,9 +111,10 @@ jobs:run: |IMAGE="${REGISTRY}/${IMAGE_NAME}"docker buildx imagetools create \- "${IMAGE}:sha-${SHA}-amd64" \- "${IMAGE}:sha-${SHA}-aarch64" \- --tag "${IMAGE}:sha-${SHA}"+ "${IMAGE}:main-amd64" \+ "${IMAGE}:main-aarch64" \+ --tag "${IMAGE}:sha-${SHA}" \+ --tag "${IMAGE}:main"- uses: sarisia/actions-status-discord@v1if: always()diff --git a/tests/Unit/ProductionImageWorkflowTest.php b/tests/Unit/ProductionImageWorkflowTest.phpindex a70e5890a5..7be4d80802 100644--- a/tests/Unit/ProductionImageWorkflowTest.php+++ b/tests/Unit/ProductionImageWorkflowTest.php@@ -1,20 +1,25 @@<?php-it('publishes v4 branch builds under the commit sha with a traceable internal version', function () {- $workflow = file_get_contents(dirname(__DIR__, 2).'/.github/workflows/coolify-sha-build.yml');+it('publishes main builds under rolling and commit sha tags with a traceable internal version', function () {+ $workflow = file_get_contents(dirname(__DIR__, 2).'/.github/workflows/coolify-main-build.yml');$dockerfile = file_get_contents(dirname(__DIR__, 2).'/docker/production/Dockerfile');$constants = file_get_contents(dirname(__DIR__, 2).'/config/constants.php');$versions = json_decode(file_get_contents(dirname(__DIR__, 2).'/versions.json'), true, flags: JSON_THROW_ON_ERROR);$nightlyVersions = json_decode(file_get_contents(dirname(__DIR__, 2).'/other/nightly/versions.json'), true, flags: JSON_THROW_ON_ERROR);expect($workflow)- ->toContain('name: Build Coolify (SHA)')+ ->toContain('name: Build Coolify Main')->toContain('branches: ["main"]')->not->toContain('v4.x')+ ->toContain('group: coolify-main-build')+ ->toContain('cancel-in-progress: false')+ ->toContain('IMAGE_NAME }}:main-${{ matrix.arch }}')+ ->toContain('--tag "${IMAGE}:main"')->toContain('short_sha=${GITHUB_SHA::7}')- ->toContain('sha-${{ steps.version.outputs.short_sha }}-${{ matrix.arch }}')->toContain('SHA: ${{ needs.build-push.outputs.short_sha }}')- ->not->toContain('sha-${{ github.sha }}')+ ->toContain('--tag "${IMAGE}:sha-${SHA}"')+ ->not->toContain('sha-${{ steps.version.outputs.short_sha }}-${{ matrix.arch }}')+ ->toContain('org.opencontainers.image.revision=${{ github.sha }}')->toContain('php bootstrap/getVersion.php')->toContain('version=${BASE_VERSION}-dev.${GITHUB_SHA::9}')->toContain('COOLIFY_VERSION=${{ steps.version.outputs.version }}')