edit github workflow to build when tag exist #11
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
name: Build and Publish | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
jobs: | |
build_publish_package: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Install Dependencies | |
run: | | |
pip install -r requirements-dev.txt | |
- name: Build Package | |
run: python setup.py sdist bdist_wheel | |
- name: Install Twine | |
run: | | |
pip install twine | |
- name: Publish to PyPI | |
run: | | |
twine upload dist/* | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PRD_QT_API_TOKEN }} | |
build_publish_docs: | |
# Deploy to cloudflare | |
runs-on: ubuntu-latest | |
needs: build_publish_package | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build Document | |
run: | | |
pip install -r requirements-dev.txt | |
sphinx-build -b html docs build | |
- name: Publish | |
uses: cloudflare/pages-action@1 | |
with: | |
apiToken: ${{ secrets.PRD_CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.PRD_CLOUDFLARE_ACCOUNT_ID }} | |
projectName: mpqp | |
directory: build |