From e1bd511b5edf44998dd0c6ba5ecfdcb1a249f85d Mon Sep 17 00:00:00 2001 From: Matthew Alan Gray Date: Thu, 18 Jan 2024 14:38:14 -0600 Subject: [PATCH] Retargeting docker image builds to push to main container registry --- .github/workflows/release-docker-image.yml | 72 +++++++++++----------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/.github/workflows/release-docker-image.yml b/.github/workflows/release-docker-image.yml index d70d9dde64..e1be77bf67 100644 --- a/.github/workflows/release-docker-image.yml +++ b/.github/workflows/release-docker-image.yml @@ -23,13 +23,13 @@ jobs: contents: read packages: write steps: - # - name: Fetching the Latest Release Tag number - # id: releaseVersion - # run: | - # release_json=$(curl https://api.github.com/repos/${{ github.repository }}/releases) - # release_tag=$(echo "$release_json" | jq -r '.[0].tag_name') - # echo "release_tag: Latest Tag is : $release_tag" - # echo "release_tag=$release_tag" >> $GITHUB_OUTPUT + - name: Fetching the Latest Release Tag number + id: releaseVersion + run: | + release_json=$(curl https://api.github.com/repos/${{ github.repository }}/releases) + release_tag=$(echo "$release_json" | jq -r '.[0].tag_name') + echo "release_tag: Latest Tag is : $release_tag" + echo "release_tag=$release_tag" >> $GITHUB_OUTPUT - name: Checkout code uses: actions/checkout@v2 @@ -46,7 +46,7 @@ jobs: uses: docker/metadata-action@v5 with: images: | - ghcr.io/solliancenet/fllm-exp02/${{ inputs.image }} + ghcr.io/${{ github.repository }}/${{ inputs.image }} tags: | type=raw,latest type=raw,release @@ -61,34 +61,34 @@ jobs: labels: ${{ steps.meta.outputs.labels }} push: true - # 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: | - # release_json=$(curl https://api.github.com/repos/${{ github.repository }}/releases) - # release_tag=$(echo "$release_json" | jq -r '.[0].tag_name') - # echo "release_tag: Latest Tag is : $release_tag" - # echo "release_tag=$release_tag" >> $GITHUB_OUTPUT + 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: | + release_json=$(curl https://api.github.com/repos/${{ github.repository }}/releases) + release_tag=$(echo "$release_json" | jq -r '.[0].tag_name') + echo "release_tag: Latest Tag is : $release_tag" + echo "release_tag=$release_tag" >> $GITHUB_OUTPUT - # - name: Checkout code - # uses: actions/checkout@v2 + - 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: 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/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 \ No newline at end of file + - name: Helm Chart Update, Package, and Push + run: | + cd ./deploy/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 \ No newline at end of file