Skip to content

Commit

Permalink
update docker publish logic from other workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronsteers committed Nov 19, 2024
1 parent 0040ed9 commit 6a471b7
Showing 1 changed file with 22 additions and 36 deletions.
58 changes: 22 additions & 36 deletions .github/workflows/pypi_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,47 +74,33 @@ jobs:
echo "Current SHA: $GITHUB_SHA"
echo "Target Version: $VERSION"
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Set up QEMU for multi-platform builds
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}

# - name: Install Poetry
# run: |
# python -m pip install --upgrade pip
# pip install poetry

# - name: Debug Poetry Search
# run: poetry search airbyte-cdk

# - name: Fetch Latest CDK Version
# run: |
# poetry search airbyte-cdk
# cdk_version=$(poetry search airbyte-cdk | grep -oP '^airbyte-cdk \K([0-9]+\.[0-9]+\.[0-9]+)' || echo "0.0.0")
# echo "CDK_VERSION=$cdk_version" >> $GITHUB_ENV
# echo "Fetched CDK Version: $cdk_version"

# - name: Simulate Main Branch Variables
# if: github.ref != 'refs/heads/main'
# run: |
# echo "Simulating main branch behavior"
# echo "GITHUB_REF=refs/heads/main" >> $GITHUB_ENV
# echo "Simulated GITHUB_REF: refs/heads/main"

# - name: Build and Publish SDM
# - name: Check for existing tag
# run: |
# tag="airbyte/source-declarative-manifest:testing-${{ env.CDK_VERSION }}-${{ github.run_number }}"
# echo "Docker Tag: $tag"
# docker build -t $tag .
# docker push $tag

# - name: Debug Docker Push
# run: |
# docker images
# echo "Pushed Docker image with tag $tag"
# tag="airbyte/source-declarative-manifest:${{ env.VERSION }}-${{ github.run_number }}"
# if DOCKER_CLI_EXPERIMENTAL=enabled docker manifest inspect "$tag" > /dev/null 2>&1; then
# echo "The tag $tag already exists on Dockerhub. Skipping publish to prevent overwrite."
# exit 1
# fi

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
airbyte/source-declarative-manifest:test
airbyte/source-declarative-manifest:test-${{ env.VERSION }}
airbyte/source-declarative-manifest:test-${{ env.VERSION }}-${{ github.run_number }}

0 comments on commit 6a471b7

Please sign in to comment.