Skip to content

Commit

Permalink
♻️ Update 2.0 branch workflows (#973)
Browse files Browse the repository at this point in the history
  • Loading branch information
trymzet committed Aug 14, 2024
1 parent 1cb1a4b commit b984959
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 37 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/2.0/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Publish viadot images with a specified tag.
name: "Publish Docker images"
run-name: "Publish viadot-*:${{ github.event.inputs.tag }} images (@${{ github.actor }})"

on:
workflow_dispatch:
inputs:
tag:
description: "The tag to use for the image."
required: true
default: "dev"
install_databricks:
description: "Whether to install Databricks source dependencies."
required: false
default: "false"
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all

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

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

- name: Build and publish viadot-lite image
uses: docker/build-push-action@v3
with:
context: .
file: docker/Dockerfile
platforms: linux/amd64
push: true
target: viadot-lite
tags: ghcr.io/${{ github.repository }}/viadot-lite:${{ github.event.inputs.tag }}

- name: Build and publish viadot-aws image
uses: docker/build-push-action@v3
with:
context: .
file: docker/Dockerfile
platforms: linux/amd64
push: true
target: viadot-aws
tags: ghcr.io/${{ github.repository }}/viadot-aws:${{ github.event.inputs.tag }}

- name: Build and publish viadot-azure image
uses: docker/build-push-action@v3
with:
context: .
file: docker/Dockerfile
platforms: linux/amd64
push: true
target: viadot-azure
tags: ghcr.io/${{ github.repository }}/viadot-azure:${{ github.event.inputs.tag }}
build-args: INSTALL_DATABRICKS=${{ github.event.inputs.install_databricks }}
48 changes: 48 additions & 0 deletions .github/workflows/2.0/publish_to_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: "Publish to PyPI"
# Publish a viadot branch to PyPI.
# The branch is either picked from the dropdown (if the workflow is ran manually),
# or the branch where the workflow was triggered.
run-name: "Publish viadot to PyPI (@${{ github.actor }})"

on:
workflow_dispatch:

jobs:
build:
name: Build distribution 📦
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install pypa/build
run: python3 -m pip install build --user

- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/

publish:
name: Publish to PyPI 🚀
needs:
- build
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/p/viadot2
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
37 changes: 0 additions & 37 deletions .github/workflows/build-2.0.yml

This file was deleted.

0 comments on commit b984959

Please sign in to comment.