Skip to content

Commit

Permalink
just upload the base image to ghcr
Browse files Browse the repository at this point in the history
  • Loading branch information
CamJN committed Jan 3, 2025
1 parent e69383c commit 9f8160a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down

0 comments on commit 9f8160a

Please sign in to comment.