fix lints and ignore files #376
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: CI | |
on: | |
pull_request: | |
branches: | |
- "*" | |
push: | |
branches: | |
- main | |
env: | |
IMAGE_NAME: fogapod/pink | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
# because pre-commit uses external mypy | |
- name: install mypy | |
run: | | |
pip install uv --no-cache-dir --disable-pip-version-check | |
uv pip install --system --no-cache -r requirements/base.txt mypy asyncpg-stubs types-redis | |
- uses: pre-commit/action@v3.0.0 | |
deploy: | |
needs: [lint] | |
if: ${{ github.event_name == 'push' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Build image | |
run: | | |
docker pull $IMAGE_NAME | |
docker build -t $IMAGE_NAME:latest . \ | |
--build-arg GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) \ | |
--build-arg GIT_COMMIT=$(git rev-parse HEAD) \ | |
--build-arg GIT_DIRTY=$(git status --porcelain=v1 2>/dev/null | wc -l) | |
- name: Log in into Docker Hub | |
run: | | |
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin | |
- name: Push image to registry | |
run: | | |
docker push $IMAGE_NAME |