-
Notifications
You must be signed in to change notification settings - Fork 1
Add Github Actions #9
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| name: Deploy | ||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| env: | ||
| AWS_DEFAULT_REGION: us-east-1 | ||
| jobs: | ||
| test: | ||
| name: Run tests | ||
| env: | ||
| COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| tox: [flake8, safety, py37, coveralls] | ||
| steps: | ||
| - uses: actions/checkout@master | ||
| - name: Setup python | ||
| uses: actions/setup-python@v1 | ||
| with: | ||
| python-version: '3.7' | ||
| architecture: x64 | ||
| - name: Install tox | ||
| run: pip install tox | ||
| - name: Run tox env | ||
| run: tox -e ${{ matrix.tox }} | ||
| deploy: | ||
| name: Deploy new workflow image | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
| needs: test | ||
| steps: | ||
| - uses: actions/checkout@master | ||
| - name: Setup python | ||
| uses: actions/setup-python@v1 | ||
| with: | ||
| python-version: '3.7' | ||
| architecture: x64 | ||
| - name: Install dependencies | ||
| run: | | ||
| python3.7 -m pip install pipenv awscli | ||
| make install | ||
| - name: Build container | ||
| run: make dist | ||
| - name: Publish container | ||
| run: make publish | ||
| - name: Redeploy cluster | ||
| run: pipenv run workflow redeploy --yes | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| name: Tests | ||
| on: push | ||
| jobs: | ||
| test: | ||
| name: Run tests | ||
| env: | ||
| COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| tox: [flake8, safety, py37, coveralls] | ||
| steps: | ||
| - uses: actions/checkout@master | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you sure we want to checkout master here? I'm still unclear on the configs so I may be missing things, but it feels like this would always checkout the master branch even on push to another branch?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know it looks like I'm checking out the master branch, but that's not what's happening. What that line does is use the master branch of the checkout action. It will checkout whatever version of the codebase triggered the workflow. There's a little more info here: https://github.com/actions/checkout#usage. |
||
| - name: Setup python | ||
| uses: actions/setup-python@v1 | ||
| with: | ||
| python-version: '3.7' | ||
| architecture: x64 | ||
| - name: Install tox | ||
| run: pip install tox | ||
| - name: Run tox env | ||
| run: tox -e ${{ matrix.tox }} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question here as the other... not sure if I don't understand or if this should be modified.