diff --git a/.github/workflows/build_deploy.yml b/.github/workflows/build_deploy.yml index 09b9506..66e1df2 100644 --- a/.github/workflows/build_deploy.yml +++ b/.github/workflows/build_deploy.yml @@ -41,17 +41,4 @@ jobs: NS_REMOTE: "${{ secrets.ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/${{ secrets.ACCOUNT_NAME }}" DOCKER_LOGIN_CMD: "aws ecr get-login-password --region ${{ secrets.AWS_REGION }} | docker login --username AWS --password-stdin ${{ secrets.ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com" run: | - make build - - - name: Deploy - if: ${{ success() }} - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - ACCOUNT_ID: ${{ secrets.ACCOUNT_ID }} - ACCOUNT_NAME: ${{ secrets.ACCOUNT_NAME }} - AWS_REGION: ${{ secrets.AWS_REGION }} - NS_REMOTE: "${{ secrets.ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/${{ secrets.ACCOUNT_NAME }}" - DOCKER_LOGIN_CMD: "aws ecr get-login-password --region ${{ secrets.AWS_REGION }} | docker login --username AWS --password-stdin ${{ secrets.ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com" - run: | - make tp \ No newline at end of file + make build-push diff --git a/Makefile b/Makefile index dc1498b..1ce451a 100644 --- a/Makefile +++ b/Makefile @@ -66,7 +66,7 @@ define ROOT_IMAGE_TASKS # Comment this out when debugging .INTERMEDIATE: $(3)/Dockerfile -.PHONY: build-$(3) clean-local-$(3) kill-$(3) rm-$(3) \ +.PHONY: build-$(3) build-push-$(3) clean-local-$(3) kill-$(3) rm-$(3) \ rmf-$(3) squash-$(3) tag-$(3) push-$(3) sp-$(3) \ bsp-$(3) tp-$(3) btp-$(3) bt-$(3) bs-$(3) \ clean-remote-$(3) run-$(3) @@ -84,6 +84,7 @@ $(3)/Dockerfile: echo "$$$${FROM_LINE_EVALED}" > $$@; \ sed '1d' $$@.in >> $$@ +# Use this option when local docker supports multi plaform build-$(3): $(3)/Dockerfile docker buildx build --rm \ --platform linux/amd64,linux/arm64 \ @@ -99,6 +100,21 @@ build-$(3): $(3)/Dockerfile --label ribose-base-container-commit-branch=$(CONTAINER_BRANCH) \ . +build-push-$(3): $(3)/Dockerfile + docker buildx build --rm \ + --platform linux/amd64,linux/arm64 \ + --output type=image,name=$(CONTAINER_REMOTE_NAME),push=true \ + -t $(CONTAINER_REMOTE_NAME) \ + -f $(3)/Dockerfile \ + --label ribose-base-container-root=$(2) \ + --label ribose-base-container-source=$(REPO_GIT_NAME)/$(3) \ + --label ribose-base-container=$(CONTAINER_REMOTE_NAME) \ + --label ribose-base-container-remote=$(CONTAINER_REMOTE_NAME) \ + --label ribose-base-container-version=$(1) \ + --label ribose-base-container-commit=$(CONTAINER_COMMIT) \ + --label ribose-base-container-commit-branch=$(CONTAINER_BRANCH) \ + . + clean-local-$(3): docker rmi -f $(CONTAINER_LOCAL_NAME) @@ -161,4 +177,5 @@ endef $(foreach i,$(ITEMS),$(eval $(call ROOT_IMAGE_TASKS,$(call GET_VERSION,$i),$(call GET_ROOT_IMAGE,$i),$(call GET_IMAGE_TYPE,$i),$(CONTAINER_TYPE)))) build: $(addprefix build-, $(notdir $(IMAGE_TYPES))) +build-push: $(addprefix build-push-, $(notdir $(IMAGE_TYPES))) tp: $(addprefix tp-, $(notdir $(IMAGE_TYPES))) \ No newline at end of file