Merge pull request #3 from robotomize/dependabot/pip/requests-2.31.0 #26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: t2r-bot | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
IMAGE_NAME: robotomize/t2r-bot | |
DOCKER_USER: ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
jobs: | |
lint: | |
name: Lint code (Python ${{ matrix.python-version }}) | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [ 3.9 ] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/[email protected] | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install poetry | |
run: pip install poetry | |
- uses: actions/[email protected] | |
id: cache-dev-deps | |
with: | |
path: .venv | |
key: venv-dev-${{ runner.os }}-py-${{ matrix.python-version }}-poetry-${{ hashFiles('poetry.lock') }} | |
restore-keys: | | |
venv-dev-${{ runner.os }}-py-${{ matrix.python-version }}-poetry- | |
venv-dev-${{ runner.os }}-py-${{ matrix.python-version }}- | |
venv-dev-${{ runner.os }}-py- | |
venv-dev-${{ runner.os }}- | |
- name: Install dependencies | |
if: steps.cache-dev-deps.outputs.cache-hit != 'true' | |
run: | | |
poetry config virtualenvs.in-project true | |
poetry install | |
- name: Run linters | |
run: | | |
poetry run ./scripts/lint | |
build: | |
name: Build Container | |
runs-on: ubuntu-20.04 | |
needs: | |
- lint | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Build image and publish to registry | |
run: | | |
docker build -t tor_to_relays . | |
docker login -u $DOCKER_USER --password $DOCKER_PASSWORD | |
docker tag tor_to_relays $IMAGE_NAME:latest | |
docker push $IMAGE_NAME:latest | |