Skip to content

Commit

Permalink
Merge pull request #2 from yuchen0cc/main
Browse files Browse the repository at this point in the history
push image
  • Loading branch information
yuchen0cc authored Aug 28, 2024
2 parents ac06d28 + bd1bc30 commit a095161
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/push_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Push Image

on:
push:
tags:
- "v*-test"

jobs:
build:
name: "Push Image"
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build
shell: bash
run: |
RELEASE_VERSION=${{ github.ref }}
RELEASE_VERSION="${RELEASE_VERSION#refs/tags/v}"
RELEASE_VERSION="${RELEASE_VERSION%-test}"
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV
PYTHON_VERSION="3.12"
PYTHON_VERSION=${PYTHON_VERSION//./}
echo "PYTHON_VERSION=${PYTHON_VERSION}" >> $GITHUB_ENV
BUILD_IMAGE="ghcr.io/${{ github.actor }}/oss-connector-for-ai-ml/connector_builder:base"
echo "BUILD_IMAGE=${BUILD_IMAGE}" >> $GITHUB_ENV
RELEASE_IMAGE="ghcr.io/${{ github.actor }}/oss-connector-for-ai-ml/connector_builder:${RELEASE_VERSION}"
echo "RELEASE_IMAGE=${RELEASE_IMAGE}" >> $GITHUB_ENV
REPO="${GITHUB_REPOSITORY,,}"
echo "REPO=${REPO}" >> $GITHUB_ENV
- name: Build and Push
uses: docker/build-push-action@v4
with:
tags: ghcr.io/${{ env.REPO }}/connector_builder:test
push: true
context: .
platforms: linux/amd64
file: .github/workflows/build_wheel/Dockerfile
build-args: |
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
PYTHON_VERSION=${{ env.PYTHON_VERSION }}
BUILD_IMAGE=${{ env.BUILD_IMAGE }}
RELEASE_IMAGE=${{ env.RELEASE_IMAGE }}

0 comments on commit a095161

Please sign in to comment.