|
1 | | -# This is a basic workflow to run tests on commit/PRs on develop |
2 | | - |
3 | 1 | name: main |
4 | 2 |
|
5 | | -# Controls when the action will run. |
6 | 3 | on: |
7 | | - # Triggers the workflow on push or pull request events |
8 | | - # but only for the develop, master, and release branches |
9 | 4 | push: |
10 | 5 | branches: |
11 | 6 | - main |
12 | 7 |
|
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 | 8 | jobs: |
19 | | - # This workflow contains a single job called "build-test" |
20 | 9 | build-test: |
21 | | - # The type of runner that the job will run on Ubuntu 18.04 (latest) |
22 | | - runs-on: self-hosted |
23 | 10 |
|
24 | | - # Steps represent a sequence of tasks that will be |
25 | | - # executed as part of the job |
| 11 | + runs-on: |
| 12 | + - self-hosted |
| 13 | + - deployer |
| 14 | + |
26 | 15 | 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: Login to Google Cloud |
38 | | - uses: google-github-actions/setup-gcloud@v0 |
39 | | - with: |
40 | | - service_account_key: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }} |
41 | | - project_id: ${{ secrets.GCP_SERVICE_ACCOUNT_PROJECT_ID }} |
42 | | - export_default_credentials: true |
43 | | - |
44 | | - - name: Build tests |
45 | | - run: 'EXCLUDE_DOCUMENTATION=1 ./ci.sh' |
46 | | - shell: bash |
47 | | - |
48 | | - |
49 | | - - name: Run Tests |
50 | | - env: |
51 | | - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
52 | | - AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} |
53 | | - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
54 | | - GCP_SERVICE_ACCOUNT_KEY: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }} |
55 | | - run: | |
56 | | - cd test |
57 | | - ./run_test_container.sh |
| 16 | + |
| 17 | + - uses: actions/checkout@v2 |
| 18 | + |
| 19 | + - name: Login to DockerHub |
| 20 | + uses: docker/login-action@v1 |
| 21 | + with: |
| 22 | + username: ${{ secrets.DOCKER_USER }} |
| 23 | + password: ${{ secrets.DOCKER_PASS }} |
| 24 | + |
| 25 | + - name: Login to Google Cloud |
| 26 | + uses: google-github-actions/setup-gcloud@v0 |
| 27 | + with: |
| 28 | + service_account_key: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }} |
| 29 | + project_id: ${{ secrets.GCP_SERVICE_ACCOUNT_PROJECT_ID }} |
| 30 | + export_default_credentials: true |
| 31 | + |
| 32 | + - name: Build and Run Tests |
| 33 | + env: |
| 34 | + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 35 | + AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} |
| 36 | + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 37 | + GCP_SERVICE_ACCOUNT_KEY: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }} |
| 38 | + run: 'EXCLUDE_DOCUMENTATION=1 EXCLUDE_DEPLOY=1 ./ci.sh' |
| 39 | + shell: bash |
58 | 40 |
|
59 | 41 | build_and_deploy_docs: |
60 | 42 | needs: |
61 | | - - build-test |
| 43 | + - build-test |
| 44 | + |
| 45 | + runs-on: |
| 46 | + - self-hosted |
| 47 | + - deployer |
| 48 | + |
| 49 | + steps: |
| 50 | + |
| 51 | + - uses: actions/checkout@v2 |
| 52 | + |
| 53 | + - name: Login to DockerHub |
| 54 | + uses: docker/login-action@v1 |
| 55 | + with: |
| 56 | + username: ${{ secrets.DOCKER_USER }} |
| 57 | + password: ${{ secrets.DOCKER_PASS }} |
| 58 | + |
| 59 | + - name: Build Notebook,docs Docker |
| 60 | + env: |
| 61 | + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 62 | + AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} |
| 63 | + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 64 | + run: | |
| 65 | + EXCLUDE_TESTING=1 EXCLUDE_DEPLOY=1 ./ci.sh |
| 66 | + shell: bash |
| 67 | + |
| 68 | + - name: Publish to PyPi |
| 69 | + env: |
| 70 | + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} |
| 71 | + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} |
| 72 | + run: | |
| 73 | + pip3 install twine |
| 74 | + bash publish.sh |
| 75 | +
|
| 76 | + - name: Tag release version |
| 77 | + run: './tag.sh' |
| 78 | + shell: bash |
| 79 | + |
| 80 | + - name: GitHub Release |
| 81 | + run: 'TOKEN=${{ secrets.GITHUBPAT }} ./github-release.sh' |
| 82 | + shell: bash |
| 83 | + |
| 84 | + deploy_web_services: |
| 85 | + needs: |
| 86 | + - build-test |
| 87 | + - build_and_deploy_docs |
62 | 88 |
|
63 | | - # The type of runner that the job will run on Ubuntu 18.04 (latest) |
64 | | - runs-on: self-hosted |
| 89 | + runs-on: ubuntu-latest |
65 | 90 |
|
66 | | - # Steps represent a sequence of tasks that will be |
67 | | - # executed as part of the job |
68 | 91 | steps: |
69 | | - # Checks-out your repository under $GITHUB_WORKSPACE, |
70 | | - # so your job can access it |
71 | | - - uses: actions/checkout@v3 |
72 | | - with: |
73 | | - fetch-depth: 0 |
74 | | - ref: ${{ github.event.pull_request.head.ref }} |
75 | | - |
76 | | - - name: Login to DockerHub |
77 | | - uses: docker/login-action@v1 |
78 | | - with: |
79 | | - username: ${{ secrets.DOCKER_USER }} |
80 | | - password: ${{ secrets.DOCKER_PASS }} |
81 | | - |
82 | | - - name: Build Notebook,docs Docker |
83 | | - env: |
84 | | - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
85 | | - AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} |
86 | | - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
87 | | - run: | |
88 | | - EXCLUDE_TESTING=1 ./ci.sh |
89 | | - shell: bash |
90 | | - |
91 | | - - name: Publish to PyPi |
92 | | - env: |
93 | | - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} |
94 | | - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} |
95 | | - run: | |
96 | | - pip3 install twine |
97 | | - bash publish.sh |
98 | | -
|
99 | | - - name: Tag release version |
100 | | - run: './tag.sh' |
101 | | - shell: bash |
102 | | - |
103 | | - - name: GitHub Release |
104 | | - run: 'TOKEN=${{ secrets.GITHUBPAT }} ./github-release.sh' |
105 | | - shell: bash |
| 92 | + |
| 93 | + - uses: actions/checkout@v2 |
| 94 | + |
| 95 | + - name: Login to DockerHub |
| 96 | + uses: docker/login-action@v1 |
| 97 | + with: |
| 98 | + username: ${{ secrets.DOCKER_USER }} |
| 99 | + password: ${{ secrets.DOCKER_PASS }} |
| 100 | + |
| 101 | + - name: Apply Terraform |
| 102 | + env: |
| 103 | + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 104 | + AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} |
| 105 | + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 106 | + run: | |
| 107 | + EXCLUDE_TESTING=1 EXCLUDE_DOCUMENTATION=1 ./ci.sh |
| 108 | + shell: bash |
0 commit comments