Skip to content

Commit

Permalink
ci(github workflows): moved deploy job in ci.yml
Browse files Browse the repository at this point in the history
Deploy job is now only executed when a tag is pushed
  • Loading branch information
Lucino772 committed Dec 22, 2021
1 parent f99689f commit da6cd27
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 36 deletions.
35 changes: 31 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: CI
name: CI/CD

on: [pull_request, push, workflow_dispatch]
on:
push:
pull_request:
branches: [ dev ]

jobs:
build:

test:
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -35,3 +37,28 @@ jobs:
pytest
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1

deploy:
needs: test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
environment: Production

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
32 changes: 0 additions & 32 deletions .github/workflows/release.yml

This file was deleted.

0 comments on commit da6cd27

Please sign in to comment.