-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d69340e
commit 7bafbc4
Showing
1 changed file
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: ci-cd | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
ci: | ||
runs-on: ubuntu-latest | ||
|
||
# define job steps | ||
steps: | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Check-out Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install poetry | ||
run: | | ||
pip install poetry | ||
poetry --version | ||
- name: Install package | ||
run: poetry install | ||
|
||
- name: Build documentation | ||
run: poetry run make html --directory docs/ | ||
|
||
cd: | ||
permissions: | ||
id-token: write | ||
contents: write | ||
# only runs if the "ci" job is successful | ||
needs: ci | ||
|
||
# only runs if new work is pushed to the main branch | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
|
||
# setups os | ||
runs-on: ubuntu-latest | ||
|
||
# define job steps | ||
steps: | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Check-out Repository | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Use Python Semantic Release to prepare a new release | ||
id: release | ||
uses: python-semantic-release/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
if: steps.release.outputs.released == 'true' | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_PASSWORD }} | ||
|
||
- name: Publish package distributions to Github Releases | ||
uses: python-semantic-release/upload-to-gh-release@main | ||
if: steps.release.outputs.released == 'true' | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |