Skip to content

Merge pull request #386 from nerdalert/escape-hyphens #224

Merge pull request #386 from nerdalert/escape-hyphens

Merge pull request #386 from nerdalert/escape-hyphens #224

Workflow file for this run

name: Publish container image
on:
push:
branches:
- main
jobs:
push_to_registries_bot:
name: Push bot container image to GHCR
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-buildx-action@v3
- name: Extract metadata (tags, labels) for gotbot image
id: gobot_meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}/instructlab-gobot
- name: Build and push gobot image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
build-args: |
GITHUB_USER=instructlab-bot
GITHUB_TOKEN=${{ secrets.BOT_GITHUB_TOKEN }}
target: gobot
push: true
tags: ${{ steps.gobot_meta.outputs.tags }}
labels: ${{ steps.gobot_meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
file: gobot/Containerfile
push_to_registries_ui:
name: Push UI container image to GHCR
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
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: |
ghcr.io/${{ github.repository }}/bot-ui
- name: Build and push ui image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
build-args: |
GITHUB_USER=instructlab-bot
GITHUB_TOKEN=${{ secrets.BOT_GITHUB_TOKEN }}
push: true
tags: ${{ steps.ui_meta.outputs.tags }}
labels: ${{ steps.ui_meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
file: ui/Containerfile
push_to_registries_apiserver:
name: Push apiserver container image to GHCR
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-buildx-action@v3
- name: Extract metadata (tags, labels) for apiserver image
id: apiserver_meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}/apiserver
- name: Build and push apiserver image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
build-args: |
GITHUB_USER=instructlab-bot
GITHUB_TOKEN=${{ secrets.BOT_GITHUB_TOKEN }}
push: true
tags: ${{ steps.apiserver_meta.outputs.tags }}
labels: ${{ steps.apiserver_meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
file: ui/apiserver/Containerfile
push_to_registries_serve:
name: Push serve container image to GHCR
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Free disk space
run: |
df -h
sudo docker rmi "$(docker image ls -aq)" >/dev/null 2>&1 || true
sudo rm -rf \
/usr/share/dotnet /usr/local/lib/android /opt/ghc \
/usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \
/usr/lib/jvm || true
sudo apt install aptitude -y >/dev/null 2>&1
sudo aptitude purge '~n ^mysql' -f -y >/dev/null 2>&1
sudo aptitude purge '~n ^dotnet' -f -y >/dev/null 2>&1
sudo apt-get autoremove -y >/dev/null 2>&1
sudo apt-get autoclean -y >/dev/null 2>&1
df -h
- name: Check out the repo
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-buildx-action@v3
- name: Extract metadata (tags, labels) for labserve image
id: labserve_meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}/instructlab-serve
- name: Build and push serve image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
build-args: |
GITHUB_USER=instructlab-bot
target: serve
push: true
tags: ${{ steps.labserve_meta.outputs.tags }}
labels: ${{ steps.labserve_meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
file: worker/Containerfile
push_to_registries_serve_base:
name: Push serve base container image to GHCR
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Free disk space
run: |
df -h
sudo docker rmi "$(docker image ls -aq)" >/dev/null 2>&1 || true
sudo rm -rf \
/usr/share/dotnet /usr/local/lib/android /opt/ghc \
/usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \
/usr/lib/jvm || true
sudo apt install aptitude -y >/dev/null 2>&1
sudo aptitude purge '~n ^mysql' -f -y >/dev/null 2>&1
sudo aptitude purge '~n ^dotnet' -f -y >/dev/null 2>&1
sudo apt-get autoremove -y >/dev/null 2>&1
sudo apt-get autoclean -y >/dev/null 2>&1
df -h
- name: Check out the repo
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-buildx-action@v3
- name: Extract metadata (tags, labels) for labserve image
id: labserve_base_meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}/instructlab-serve-base
- name: Build and push serve image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
build-args: |
GITHUB_USER=instructlab-bot
target: serve
push: true
tags: ${{ steps.labserve_base_meta.outputs.tags }}
labels: ${{ steps.labserve_base_meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
file: worker/Containerfile.servebase