Skip to content

Commit

Permalink
create reusable workflow and reuse it
Browse files Browse the repository at this point in the history
  • Loading branch information
zain-sohail committed Oct 11, 2023
1 parent 6dc8200 commit ec5ed2f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 23 deletions.
25 changes: 2 additions & 23 deletions .github/workflows/cache_setup.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: ci
name: cache

on:
# Triggers the workflow on push but only for the main branch
push:
branches: [ workflow_trials ]
workflow_call:

jobs:
cache:
Expand All @@ -19,23 +18,3 @@ jobs:
with:
python-version: 3.8
poetry-version: 1.2.2

#------------------------#
# Run your actual job #
#------------------------#
# - name: Run tests
# run: |
# poetry run pytest

documentation:
needs: [cache]
runs-on: ubuntu-latest
steps:
- name: Export requirements.txt
run: poetry export --without-hashes --format=requirements.txt -o docs/requirements.txt -E docs -E notebook
# - name: Commit changes
# uses: EndBug/add-and-commit@v9
# with:
# default_author: github_actions
# message: 'Updating requirements for docs'
# add: 'docs/requirements.txt'
22 changes: 22 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: documentation building

on:
# Triggers the workflow on push but only for the main branch
push:
branches: [ workflow_trials ]

jobs:
documentation:
runs-on: ubuntu-latest

steps:
- name: cache
uses: ./.github/workflows/cache_setup.yml
- name: Export requirements.txt
run: poetry export --without-hashes --format=requirements.txt -o docs/requirements.txt -E docs -E notebook
# - name: Commit changes
# uses: EndBug/add-and-commit@v9
# with:
# default_author: github_actions
# message: 'Updating requirements for docs'
# add: 'docs/requirements.txt'

0 comments on commit ec5ed2f

Please sign in to comment.