From f6cb990b3680611a3740c173965ed40b5a9fe53b Mon Sep 17 00:00:00 2001 From: Mikael Siidorow Date: Fri, 3 May 2024 15:13:52 +0300 Subject: [PATCH] add linting and deploy github actions --- .github/workflows/lint.yml | 40 ++++++++++++++++++++++++++++++++++++++ .github/workflows/main.yml | 22 +++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..cbcc606 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,40 @@ +name: Lint and typecheck + +on: + pull_request: + branches: + - main + workflow_call: + +jobs: + lint: + name: Lint and typecheck + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install poetry + run: | + python3 -m pip install --upgrade pip + python3 -m pip install --user pipx + python3 -m pipx ensurepath + pipx install poetry + + - name: Set up Python 3.12.3 + uses: actions/setup-python@v5 + with: + python-version: "3.12.3" + cache: "poetry" + + - name: Install dependencies + run: | + poetry install + + - name: Lint with ruff + run: | + poetry run poe lint + + - name: Typecheck with mypy + run: | + poetry run poe check diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..941db0e --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,22 @@ +name: Fly Deploy + +on: + push: + branches: + - main + +jobs: + lint: + uses: ./.github/workflows/lint.yml + deploy: + name: Deploy to Fly + runs-on: ubuntu-latest + concurrency: deploy-group + needs: + - lint + steps: + - uses: actions/checkout@v4 + - uses: superfly/flyctl-actions/setup-flyctl@v1 + - run: flyctl deploy --remote-only + env: + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}