Skip to content

Commit

Permalink
fix: remove comments from multi-line command (#4)
Browse files Browse the repository at this point in the history
* fix: remove comments from multi-line command

* chore: improve outputs
  • Loading branch information
NickLarsenNZ authored Oct 10, 2024
1 parent c179c50 commit ab97c67
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ All subsequent tasks must use this value to ensure consistency.
#### Inputs

- `image-name`
- `image-index-manifest-tag`
- `image-name` (eg: `kafka`)
- `image-index-manifest-tag` (eg: `3.4.1-stackable0.0.0-dev`)
- `container-file` (defaults to `Dockerfile`)
- `build-context` (defaults to `.`)
<!--
Expand All @@ -48,7 +48,9 @@ TODO (@NickLarsenNZ): Allow optional buildx cache

#### Outputs

- `image-manifest-tag`
- `image-repository-uri` (eg: `localhost/kafka`)
- `image-manifest-tag` (eg: `3.4.1-stackable0.0.0-dev-amd64`)
- `image-manifest-uri` (eg: `localhost/kafka:3.4.1-stackable0.0.0-dev-amd64`)

[build-container-image]: ./build-container-image/action.yml

Expand Down
21 changes: 17 additions & 4 deletions build-container-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,20 @@ inputs:
# description: Build cache password
# required: true
outputs:
image-repository-uri:
description: |
The locally tagged name of the image, for example: `localhost/kafka`
value: ${{ steps.build-image.outputs.IMAGE_REPOSITORY_URI }}
image-manifest-tag:
description: |
Human-readable tag (usually the version) with architecture information,
for example: `3.4.1-stackable0.0.0-dev-amd64`
value: ${{ steps.build-image.outputs.IMAGE_MANIFEST_TAG }}
image-manifest-uri:
description: |
The full image manifest uri, for example:
localhost/kafka:3.4.1-stackable0.0.0-dev-amd64
value: ${{ steps.build-image.outputs.IMAGE_MANIFEST_URI }}
runs:
using: composite
steps:
Expand Down Expand Up @@ -78,11 +87,15 @@ runs:
IMAGE_MANIFEST_TAG="${IMAGE_INDEX_MANIFEST_TAG}-${IMAGE_ARCH}"
echo "IMAGE_MANIFEST_TAG=${IMAGE_MANIFEST_TAG}" | tee -a $GITHUB_OUTPUT
IMAGE_REPOSITORY_URI="localhost/${IMAGE_NAME}"
echo "IMAGE_REPOSITORY_URI=${IMAGE_REPOSITORY_URI}" | tee -a $GITHUB_OUTPUT
IMAGE_MANIFEST_URI="${IMAGE_REPOSITORY_URI}:${IMAGE_MANIFEST_TAG}"
echo "IMAGE_MANIFEST_URI=${IMAGE_MANIFEST_URI}" | tee -a $GITHUB_OUTPUT
# TODO (@NickLarsenNZ): Allow optional buildx cache
docker buildx build \
--file "${CONTAINER_FILE}" \
--platform "linux/${IMAGE_ARCH}" \
--tag "localhost/${IMAGE_NAME}:${IMAGE_MANIFEST_TAG}" \
# TODO (@NickLarsenNZ): Allow optional buildx cache
# --cache-to ... \
# --cache-from ... \
--tag "${IMAGE_MANIFEST_URI}" \
"${BUILD_CONTEXT}"

0 comments on commit ab97c67

Please sign in to comment.