Skip to content

Commit

Permalink
feat: Update GitHub actions (#23)
Browse files Browse the repository at this point in the history
* Update Github Actions
  • Loading branch information
RanbirAulakh authored Oct 18, 2023
1 parent 077e839 commit b37d047
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
name: Docs
on: [push, pull_request, workflow_dispatch]
name: Generate and Publish Documentation for OSML Imagery Toolkit

on:
workflow_call:

permissions:
contents: write

jobs:
docs:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v3
- name: Install dependencies
run: |
Expand All @@ -19,7 +24,6 @@ jobs:
tox -e docs
- name: Deploy
uses: peaceiris/[email protected]
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/osml-imagery-toolkit-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: "OSML Imagery Toolkit Build Workflow"

on:
pull_request:
branches: ["main", "dev"]

jobs:
Build_Validate_Tox:
uses: ./.github/workflows/python-tox.yml
secrets: inherit
18 changes: 18 additions & 0 deletions .github/workflows/osml-imagery-toolkit-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "OSML Imagery Toolkit Build and Publish Workflow"

on:
push:
branches: ["main"]

jobs:
Build_Validate_Tox:
uses: ./.github/workflows/python-tox.yml
secrets: inherit
Publish_Python:
needs: [Build_Validate_Tox]
uses: ./.github/workflows/python-publish.yml
secrets: inherit
Publish_Documentation:
needs: [Publish_Python]
uses: ./.github/workflows/documentation-publish.yml
secrets: inherit
10 changes: 5 additions & 5 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package
name: Publish Python Package

on:
workflow_call:
release:
types: [published]

Expand All @@ -17,11 +18,10 @@ permissions:

jobs:
deploy:

if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
Expand All @@ -33,7 +33,7 @@ jobs:
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
uses: pypa/gh-action-pypi-publish@v1.8.10
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Tox Build/Validation
name: Build/Validation with Tox

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_call:

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
lfs: 'true'
ssh-key: ${{ secrets.git_ssh_key }}
lfs: 'true'
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
Expand Down

0 comments on commit b37d047

Please sign in to comment.