-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from vishnoianil/publish-ui-image
Publish ui container image to ghcr.io
- Loading branch information
Showing
2 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Publish container images | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }}/ui | ||
|
||
jobs: | ||
build_and_publish_ui_image: | ||
name: Push UI container image to GHCR | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
contents: read | ||
attestations: write | ||
id-token: write | ||
|
||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Extract metadata (tags, labels) for UI image | ||
id: ui_meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push ui image | ||
id: push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.ui_meta.outputs.tags }} | ||
labels: ${{ steps.ui_meta.outputs.labels }} | ||
platforms: linux/amd64,linux/arm64 | ||
target: ui | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
file: Containerfile | ||
|
||
- name: Generate artifact attestation | ||
uses: actions/attest-build-provenance@v1 | ||
with: | ||
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} | ||
subject-digest: ${{ steps.push.outputs.digest }} | ||
push-to-registry: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
.PHONY: help | ||
help: | ||
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-18s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) | ||
|
||
# | ||
# If you want to see the full commands, run: | ||
# NOISY_BUILD=y make | ||
# | ||
ifeq ($(NOISY_BUILD),) | ||
ECHO_PREFIX=@ | ||
CMD_PREFIX=@ | ||
PIPE_DEV_NULL=> /dev/null 2> /dev/null | ||
else | ||
ECHO_PREFIX=@\# | ||
CMD_PREFIX= | ||
PIPE_DEV_NULL= | ||
endif | ||
|
||
.PHONY: md-lint | ||
md-lint: ## Lint markdown files | ||
$(ECHO_PREFIX) printf " %-12s ./...\n" "[MD LINT]" | ||
$(CMD_PREFIX) podman run --rm -v $(CURDIR):/workdir docker.io/davidanson/markdownlint-cli2:v0.6.0 > /dev/null | ||
|
||
.PHONY: action-lint | ||
action-lint: ## Lint GitHub Action workflows | ||
$(ECHO_PREFIX) printf " %-12s .github/...\n" "[ACTION LINT]" | ||
$(CMD_PREFIX) if ! which actionlint $(PIPE_DEV_NULL) ; then \ | ||
echo "Please install actionlint." ; \ | ||
echo "go install github.com/rhysd/actionlint/cmd/actionlint@latest" ; \ | ||
exit 1 ; \ | ||
fi | ||
$(CMD_PREFIX) actionlint -color | ||
|
||
ui-image: Containerfile ## Build continaer image for the InstructLab UI | ||
$(ECHO_PREFIX) printf " %-12s Containerfile\n" "[PODMAN]" | ||
$(CMD_PREFIX) podman build -f Containerfile -t ghcr.io/instructlab/ui/ui:main . |