diff --git a/.github/workflows/coolify-sha-build.yml b/.github/workflows/coolify-main-build.yml similarity index 82% rename from .github/workflows/coolify-sha-build.yml rename to .github/workflows/coolify-main-build.yml index 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 Main on: push: @@ -8,6 +8,10 @@ permissions: contents: read packages: write +concurrency: + group: coolify-main-build + cancel-in-progress: false + env: GITHUB_REGISTRY: ghcr.io DOCKER_REGISTRY: docker.io @@ -62,9 +66,11 @@ jobs: push: true build-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@v1 if: always() diff --git a/tests/Unit/ProductionImageWorkflowTest.php b/tests/Unit/ProductionImageWorkflowTest.php index a70e5890a5..7be4d80802 100644 --- a/tests/Unit/ProductionImageWorkflowTest.php +++ b/tests/Unit/ProductionImageWorkflowTest.php @@ -1,20 +1,25 @@ 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 }}')