From 9f8160a335f07f7a4adf5d0b4cc7dc063cd47f15 Mon Sep 17 00:00:00 2001 From: Camden Narzt Date: Fri, 3 Jan 2025 09:25:09 -0700 Subject: [PATCH] just upload the base image to ghcr --- .github/workflows/main.yml | 26 ++++++++++++++------------ Makefile | 4 ++-- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 18810d4..2c80c0d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -41,11 +41,21 @@ jobs: env: BUILD_AMD64: ${{ fromJSON('[0, 1]')[matrix.arch.name == 'amd64'] }} BUILD_ARM64: ${{ fromJSON('[0, 1]')[matrix.arch.name == 'arm64'] }} - - name: Upload artifact - uses: actions/upload-artifact@v4 + - name: Log in to the Container registry + if: ${{ github.event.pull_request.merged || github.actor == 'CamJN' }} + uses: docker/login-action@v3 + id: login with: - name: base_${{ matrix.arch.name }} - path: passenger-base-a*64.tar.gz + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Push to github container registry + if: ${{ success() && steps.login.conclusion != 'skipped' }} + run: make push_base + env: + BUILD_AMD64: ${{ fromJSON('[0, 1]')[matrix.arch.name == 'amd64'] }} + BUILD_ARM64: ${{ fromJSON('[0, 1]')[matrix.arch.name == 'arm64'] }} + build: needs: pre_build @@ -86,14 +96,6 @@ jobs: uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Download artifact - uses: actions/download-artifact@v4 - with: - name: base_${{ matrix.arch.name }} - path: /tmp/passenger-base-${{ matrix.arch.name }} - - name: Extract base image - run: tar -xf ./passenger-base-${{ matrix.arch.name }}.tar.gz - working-directory: /tmp/passenger-base-${{ matrix.arch.name }} - name: "Run make build_${{ matrix.img }}" run: "make build_${{ matrix.img }}" env: diff --git a/Makefile b/Makefile index 66c3e55..1ee4763 100644 --- a/Makefile +++ b/Makefile @@ -98,10 +98,10 @@ build_%: echo final=1 >> ${*}_image/buildconfig; \ fi ifeq ($(_build_amd64),1) - docker buildx build --progress=plain --platform linux/amd64 $(EXTRA_BUILD_FLAGS) --build-arg NAME=$(NAME) --build-arg ARCH=amd64 -t $(NAME)-$*:$(VERSION)-amd64 --rm --build-context $(NAME)-base:current-amd64=oci-layout:///tmp/passenger-base-amd64 $*_image + docker buildx build --progress=plain --platform linux/amd64 $(EXTRA_BUILD_FLAGS) --build-arg NAME=$(NAME) --build-arg ARCH=amd64 -t $(NAME)-$*:$(VERSION)-amd64 --rm $*_image endif ifeq ($(_build_arm64),1) - docker buildx build --progress=plain --platform linux/arm64 $(EXTRA_BUILD_FLAGS) --build-arg NAME=$(NAME) --build-arg ARCH=arm64 -t $(NAME)-$*:$(VERSION)-arm64 --rm --build-context $(NAME)-base:current-arm64=oci-layout:///tmp/passenger-base-arm64 $*_image + docker buildx build --progress=plain --platform linux/arm64 $(EXTRA_BUILD_FLAGS) --build-arg NAME=$(NAME) --build-arg ARCH=arm64 -t $(NAME)-$*:$(VERSION)-arm64 --rm $*_image endif labels: $(foreach image, $(ALL_IMAGES), label_${image})