1+ # This is a basic workflow to run tests on commit/PRs on develop
2+
3+ name : main
4+
5+ # Controls when the action will run.
6+ on :
7+ # Triggers the workflow on push or pull request events
8+ # but only for the develop, master, and release branches
9+ push :
10+ branches :
11+ - main
12+
13+ # Allows you to run this workflow manually from the Actions tab
14+ workflow_dispatch :
15+
16+ # A workflow run is made up of one or more jobs
17+ # that can run sequentially or in parallel
18+ jobs :
19+ # This workflow contains a single job called "build-test"
20+ build-test :
21+ # The type of runner that the job will run on Ubuntu 18.04 (latest)
22+ runs-on : ubuntu-latest
23+
24+ # Steps represent a sequence of tasks that will be
25+ # executed as part of the job
26+ steps :
27+ # Checks-out your repository under $GITHUB_WORKSPACE,
28+ # so your job can access it
29+ - uses : actions/checkout@v2
30+
31+ - name : Login to DockerHub
32+ uses : docker/login-action@v1
33+ with :
34+ username : ${{ secrets.DOCKER_USER }}
35+ password : ${{ secrets.DOCKER_PASS }}
36+
37+ - name : Run Tests
38+ env :
39+ AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
40+ AWS_DEFAULT_REGION : ${{ secrets.AWS_DEFAULT_REGION }}
41+ AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
42+ run : |
43+ pip3 install ipython torch torchvision boto3
44+ cd test
45+ bash run_test.sh
46+
47+ build_and_deploy_docs :
48+
49+ # The type of runner that the job will run on Ubuntu 18.04 (latest)
50+ runs-on : ubuntu-latest
51+
52+ # Steps represent a sequence of tasks that will be
53+ # executed as part of the job
54+ steps :
55+ # Checks-out your repository under $GITHUB_WORKSPACE,
56+ # so your job can access it
57+ - uses : actions/checkout@v3
58+ with :
59+ fetch-depth : 0
60+ ref : ${{ github.event.pull_request.head.ref }}
61+
62+ - name : Login to DockerHub
63+ uses : docker/login-action@v1
64+ with :
65+ username : ${{ secrets.DOCKER_USER }}
66+ password : ${{ secrets.DOCKER_PASS }}
67+
68+ - name : Build Notebook Docker
69+ run : ' ./ci.sh'
70+ shell : bash
71+
72+ - name : Publish to PyPi
73+ env :
74+ TWINE_USERNAME : ${{ secrets.PYPI_USERNAME }}
75+ TWINE_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
76+ run : |
77+ pip3 install twine
78+ bash publish.sh
79+
80+ - name : Tag release version
81+ run : ' ./tag.sh'
82+ shell : bash
83+
84+ - name : GitHub Release
85+ run : ' TOKEN=${{ secrets.GITHUBPAT }} ./github-release.sh'
86+ shell : bash
0 commit comments