diff --git a/.github/workflows/coolify-branch-arm64.yml b/.github/workflows/coolify-branch-arm64.yml new file mode 100644 index 0000000000..d94a84097d --- /dev/null +++ b/.github/workflows/coolify-branch-arm64.yml @@ -0,0 +1,58 @@ +name: Build Coolify ARM64 Branch Image + +on: + workflow_dispatch: + +permissions: + contents: read + packages: write + +jobs: + prepare: + runs-on: ubuntu-24.04 + outputs: + image_tag: ${{ steps.image.outputs.image_tag }} + version: ${{ steps.image.outputs.version }} + steps: + - name: Resolve image tag + id: image + env: + BRANCH_NAME: ${{ github.ref_name }} + run: | + IMAGE_TAG=$(echo "${BRANCH_NAME}" | tr '[:upper:]/_' '[:lower:]--' | sed -E 's/[^a-z0-9.-]+/-/g; s/^[.-]+//; s/[.-]+$//') + if [ -z "${IMAGE_TAG}" ]; then + echo "Could not create an image tag from branch: ${BRANCH_NAME}" + exit 1 + fi + + SHORT_SHA="${GITHUB_SHA::7}" + echo "image_tag=${IMAGE_TAG}" >> "${GITHUB_OUTPUT}" + echo "version=${IMAGE_TAG}.${SHORT_SHA}" >> "${GITHUB_OUTPUT}" + + build: + needs: prepare + runs-on: ubuntu-24.04-arm + steps: + - uses: actions/checkout@v5 + with: + persist-credentials: false + + - uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push ARM64 image + uses: docker/build-push-action@v6 + with: + context: . + file: docker/production/Dockerfile + platforms: linux/arm64 + push: true + build-args: | + COOLIFY_VERSION=${{ needs.prepare.outputs.version }} + tags: ghcr.io/coollabsio/coolify:${{ needs.prepare.outputs.image_tag }}