Skip to content

Commit

Permalink
#149 Add push and deploy workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcinMaciaszek committed May 13, 2020
1 parent d99cda2 commit 6a8feb2
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- '*'

jobs:
piepline:
test:
name: Build and test rfhub2
runs-on: ubuntu-latest
services:
Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/rfhub2_push_and_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: rfhub2-push-and-deploy

on:
push:
branches:
- master
paths:
- 'rfhub2/version.py'

jobs:
push:
name: Push rfhub2 to PyPI
if: steps.extract_branch.outputs.branch == 'master'
needs: test
runs-on: ubuntu-latest
node-version: 13.x
python-version: 3.8

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ python-version }}

- name: Cache Python packages
uses: actions/cache@v1
id: cache-pip
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements-dev.txt', '**/requirements-postgres.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements-dev.txt', '**/requirements-postgres.txt') }}
- name: Use Node.js ${{ node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ node-version }}

- name: Install yarn dependencies
uses: bahmutov/npm-install@v1
with:
working-directory: frontend

- name: Build UI
run: ./build_ui.sh

- name: Build rfhub2 python package
run: python setup.py sdist bdist_wheel

- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}

- name: Deploy to Heroku
uses: Suvink/[email protected]
with:
heroku_app_name: rfhub2-demo
heroku_email: [email protected]
dontuseforce: false
env:
HEROKU_TOKEN: '${{ secrets.HEROKU_AUTH_TOKEN }}'
BOT_TOKEN: '${{ secrets.BOT_TOKEN }}'
CHAT_ID: '${{ secrets.CHAT_ID }}'

0 comments on commit 6a8feb2

Please sign in to comment.