diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..f8af254 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..17bb566 --- /dev/null +++ b/.github/workflows/test.yml @@ -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 + - 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 }} diff --git a/tox.ini b/tox.ini index b2aac2b..5e5986a 100644 --- a/tox.ini +++ b/tox.ini @@ -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