Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskim06 committed Sep 28, 2023
1 parent 678ac5e commit 265b065
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 72 deletions.
61 changes: 1 addition & 60 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,71 +52,12 @@ jobs:
- name: Run test
run: make test

build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
with:
ref: ${{ github.event.inputs.git-ref }}

- name: Set up Go
id: go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: '1.20'
check-latest: true

- name: Set up QEMU
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325 # v2.2.1
with:
version: latest

- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}

- name: Prepare Host
env:
KUBECTL_VERSION: ${{ vars.KUBECTL_VERSION }}
run: |
sudo apt-get -qq update || true
sudo apt-get install -y pigz
curl -LO https://storage.googleapis.com/kubernetes-release/release/$KUBECTL_VERSION/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
- name: Build images
env:
REGISTRY: ingress-controller
TAG: 1.0.0-dev
run: |
echo "building e2e images..."
make clean-image build image
make -C test/e2e-image image
echo "creating images cache..."
docker save \
nginx-ingress-controller:e2e \
ingress-controller/controller:1.0.0-dev \
| pigz > docker.tar.gz
- name: cache
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1
with:
name: docker.tar.gz
path: docker.tar.gz

release:
if: ${{ github.event.inputs.publish }}
name: Release
runs-on: ubuntu-latest
needs:
- build
- test-and-lint
steps:
- name: Check out ingress-nginx
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
Expand Down
24 changes: 12 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -250,18 +250,18 @@ release: ensure-buildx clean
--build-arg BUILD_ID="$(BUILD_ID)" \
-t $(REGISTRY)/controller:$(TAG) rootfs

docker buildx build \
--no-cache \
$(MAC_DOCKER_FLAGS) \
--push \
--pull \
--progress plain \
--platform $(BUILDX_PLATFORMS) \
--build-arg BASE_IMAGE="$(BASE_IMAGE)" \
--build-arg VERSION="$(TAG)" \
--build-arg COMMIT_SHA="$(COMMIT_SHA)" \
--build-arg BUILD_ID="$(BUILD_ID)" \
-t $(REGISTRY)/controller-chroot:$(TAG) rootfs -f rootfs/Dockerfile-chroot
# docker buildx build \
# --no-cache \
# $(MAC_DOCKER_FLAGS) \
# --push \
# --pull \
# --progress plain \
# --platform $(BUILDX_PLATFORMS) \
# --build-arg BASE_IMAGE="$(BASE_IMAGE)" \
# --build-arg VERSION="$(TAG)" \
# --build-arg COMMIT_SHA="$(COMMIT_SHA)" \
# --build-arg BUILD_ID="$(BUILD_ID)" \
# -t $(REGISTRY)/controller-chroot:$(TAG) rootfs -f rootfs/Dockerfile-chroot

.PHONY: build-docs
build-docs:
Expand Down

0 comments on commit 265b065

Please sign in to comment.