Skip to content
This repository was archived by the owner on Apr 14, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/deploy.yml
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
Copy link
Member

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.

- 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
22 changes: 22 additions & 0 deletions .github/workflows/test.yml
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
Copy link
Member

Choose a reason for hiding this comment

The 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?

Copy link
Author

Choose a reason for hiding this comment

The 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 }}
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ commands = pipenv run flake8 manager tests
commands = pipenv check

[testenv:coveralls]
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH COVERALLS_REPO_TOKEN

commands =
pipenv install --dev
Expand Down