8000 Publish UI image to quay.io container image registry by vishnoianil · Pull Request #86 · instructlab/ui · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Publish UI image to quay.io container image registry #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 50 additions & 12 deletions .github/workflows/images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ on:
- main

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}/ui
GHCR_REGISTRY: ghcr.io
GHCR_UI_IMAGE_NAME: ${{ github.repository }}/ui
QUAY_REGISTRY: quay.io
QUAY_UI_IMAGE_NAME: instructlab-ui/ui

jobs:
build_and_publish_ui_image:
name: Push UI container image to GHCR
name: Push UI container image to GHCR and QUAY
runs-on: ubuntu-latest
environment: registry-creds
permissions:
packages: write
contents: read
Expand All @@ -23,29 +26,51 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v4

- name: Log in to the Container registry
- name: Log in to the GHCR container image registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
registry: ${{ env.GHCR_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: docker/setup-buildx-action@v3
- name: Log in to Quay container image registry
uses: docker/login-action@v3
with:
registry: ${{ env.QUAY_REGISTRY }}
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-

- name: Extract metadata (tags, labels) for UI image
id: ui_meta
id: ghcr_ui_meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
images: ${{ env.GHCR_REGISTRY }}/${{ env.GHCR_UI_IMAGE_NAME }}

- name: Build and push ui image
- name: Extract metadata (tags, labels) for UI image
id: quay_ui_meta
uses: docker/metadata-action@v5
with:
images: ${{ env.QUAY_REGISTRY }}/${{ env.QUAY_UI_IMAGE_NAME }}

- name: Build and push ui image to ghcr.io
id: push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.ui_meta.outputs.tags }}
labels: ${{ steps.ui_meta.outputs.labels }}
tags: ${{ steps.ghcr_ui_meta.outputs.tags }}
labels: ${{ steps.ghcr_ui_meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
Expand All @@ -54,6 +79,19 @@ jobs:
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-name: ${{ env.GHCR_REGISTRY }}/${{ env.GHCR_UI_IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

- name: Build and push ui image to quay.io
id: push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.quay_ui_meta.outputs.tags }}
labels: ${{ steps.quay_ui_meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
file: Containerfile
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ stats.json
auth.log
tsconfig.tsbuildinfo
.idea
.vscode
0