-
Notifications
You must be signed in to change notification settings - Fork 4
52 lines (50 loc) · 1.69 KB
/
push_image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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 }}