Skip to content

Commit

Permalink
Add CD using GH reusable actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
hubert-rutkowski85 committed Oct 22, 2024
1 parent 939c715 commit 21189c0
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CD

on:
push:
branches:
# - connectors-dev

jobs:
detect_changes:
runs-on: ubuntu-latest
outputs:
unstructured_ingest_changed: ${{ steps.filter.outputs.unstructured_ingest }}
steps:
- uses: actions/checkout@v4

- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
unstructured_ingest:
- 'unstructured_ingest/**'
ci_unstructured_ingest:
needs: detect_changes
if: ${{ needs.detect_changes.outputs.unstructured_ingest_changed == 'true' }}
uses: ./.github/workflows/cd_project.yml
with:
work-dir: "."
secrets: inherit
43 changes: 43 additions & 0 deletions .github/workflows/cd_project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CD for platform-libs

on:
workflow_call:
inputs:
work-dir:
description: "working directory for platform-libs"
required: true
type: string


env:
PYTHON_VERSION: "3.10"

jobs:

setup-environment:
uses: Unstructured-IO/github-workflows/.github/workflows/setup-environment.yml@main
with:
work-dir: ${{ inputs.work-dir }}
secrets: inherit

build:
needs: [setup-environment]
uses: Unstructured-IO/github-workflows/.github/workflows/build.yml@main
with:
build-targets: '["build-package"]'
work-dir: ${{ inputs.work-dir }}
secrets: inherit


publish-package:
needs: [setup-environment, build]
uses: Unstructured-IO/github-workflows/.github/workflows/publish.yml@main
with:
work-dir: ${{ inputs.work-dir }}
publish-targets: "publish-package"
twine-repository-url: https://pkgs.dev.azure.com/unstructured/_packaging/unstructured/pypi/upload/
twine-username: unstructured
package-name: ${{ needs.build.outputs.package-name }}
secrets:
twine-password: ${{ secrets.PRIVATE_PYPI_KEY }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
6 changes: 6 additions & 0 deletions tasks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

from invoke import task

@task
def build_package(c):
c.run("python3 -m build")

0 comments on commit 21189c0

Please sign in to comment.