Skip to content

Commit

Permalink
Adding change to build and push to 0.4.0-prerelease container registry
Browse files Browse the repository at this point in the history
  • Loading branch information
hatboyzero committed Feb 22, 2024
1 parent c3ce334 commit a1362cc
Showing 1 changed file with 95 additions and 95 deletions.
190 changes: 95 additions & 95 deletions .github/workflows/release-docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,95 +1,95 @@
name: Docker Image Build and Push

on:
workflow_call:
inputs:
registry:
type: string
default: ghcr.io
image:
type: string
required: true
context:
type: string
required: true
dockerfile:
type: string
required: true

jobs:
docker_image_build_and_push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Fetching the Latest Release Tag number
id: releaseVersion
run: |
GIT_RELEASE=$(echo ${{ github.ref_name }} | cut -d'/' -f 2)
echo "GIT_RELEASE=$GIT_RELEASE" >> $GITHUB_ENV
echo "release_tag: Latest Tag is : $GIT_RELEASE"
echo "release_tag=$GIT_RELEASE" >> $GITHUB_OUTPUT
- name: Checkout code
uses: actions/checkout@v2

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}/${{ inputs.image }}
tags: |
type=semver,pattern={{version}},value=${{ steps.releaseVersion.outputs.release_tag }}
type=sha,format=long
- name: Build and push Docker images
uses: docker/build-push-action@v5
with:
context: ${{ inputs.context }}
file: ${{ inputs.dockerfile }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true
build-args: |
FOUNDATIONALLM_VERSION=${{ steps.releaseVersion.outputs.release_tag }}
helm_chart_package_and_push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Fetching the Latest Release Tag number
id: releaseVersion
run: |
GIT_RELEASE=$(echo ${{ github.ref_name }} | cut -d'/' -f 2)
echo "GIT_RELEASE=$GIT_RELEASE" >> $GITHUB_ENV
echo "release_tag: Latest Tag is : $GIT_RELEASE"
echo "release_tag=$GIT_RELEASE" >> $GITHUB_OUTPUT
- name: Checkout code
uses: actions/checkout@v2

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Helm Chart Update, Package, and Push
run: |
cd ./deploy/common/helm/${{ inputs.image }}
sed -i "s/version\: 0\.0\.0/version\: ${{ steps.releaseVersion.outputs.release_tag }}/" Chart.yaml
sed -i "s/tag\: latest/tag\: ${{ steps.releaseVersion.outputs.release_tag }}/" values.yaml
helm package . --app-version ${{ steps.releaseVersion.outputs.release_tag }}
helm push ${{ inputs.image }}-${{ steps.releaseVersion.outputs.release_tag }}.tgz oci://ghcr.io/${{ github.repository }}/helm
name: Docker Image Build and Push

on:
workflow_call:
inputs:
registry:
type: string
default: ghcr.io
image:
type: string
required: true
context:
type: string
required: true
dockerfile:
type: string
required: true

jobs:
docker_image_build_and_push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Fetching the Latest Release Tag number
id: releaseVersion
run: |
GIT_RELEASE=$(echo ${{ github.ref_name }} | cut -d'/' -f 2)
echo "GIT_RELEASE=$GIT_RELEASE" >> $GITHUB_ENV
echo "release_tag: Latest Tag is : $GIT_RELEASE"
echo "release_tag=$GIT_RELEASE" >> $GITHUB_OUTPUT
- name: Checkout code
uses: actions/checkout@v2

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/solliancenet/fllm-0.4.0-prerelease/${{ inputs.image }}
tags: |
type=semver,pattern={{version}},value=${{ steps.releaseVersion.outputs.release_tag }}
type=sha,format=long
- name: Build and push Docker images
uses: docker/build-push-action@v5
with:
context: ${{ inputs.context }}
file: ${{ inputs.dockerfile }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true
build-args: |
FOUNDATIONALLM_VERSION=${{ steps.releaseVersion.outputs.release_tag }}
helm_chart_package_and_push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Fetching the Latest Release Tag number
id: releaseVersion
run: |
GIT_RELEASE=$(echo ${{ github.ref_name }} | cut -d'/' -f 2)
echo "GIT_RELEASE=$GIT_RELEASE" >> $GITHUB_ENV
echo "release_tag: Latest Tag is : $GIT_RELEASE"
echo "release_tag=$GIT_RELEASE" >> $GITHUB_OUTPUT
- name: Checkout code
uses: actions/checkout@v2

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Helm Chart Update, Package, and Push
run: |
cd ./deploy/common/helm/${{ inputs.image }}
sed -i "s/version\: 0\.0\.0/version\: ${{ steps.releaseVersion.outputs.release_tag }}/" Chart.yaml
sed -i "s/tag\: latest/tag\: ${{ steps.releaseVersion.outputs.release_tag }}/" values.yaml
helm package . --app-version ${{ steps.releaseVersion.outputs.release_tag }}
helm push ${{ inputs.image }}-${{ steps.releaseVersion.outputs.release_tag }}.tgz oci://ghcr.io/solliancenet/fllm-0.4.0-prerelease/helm

0 comments on commit a1362cc

Please sign in to comment.