🛠️ Deployment fixes #36
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: Pipeline | |
on: | |
push: | |
jobs: | |
local-development: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Set up python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Init local development environment | |
run: | | |
make install-ci | |
make install SYNC="" | |
# Lint | |
check-ruff: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- uses: ./.github/actions/lint-install | |
- name: Run ruff | |
run: | | |
make check-ruff | |
check-black: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- uses: ./.github/actions/lint-install | |
- name: Run black | |
run: | | |
make check-black | |
check-isort: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- uses: ./.github/actions/lint-install | |
- name: Run isort | |
run: | | |
make check-isort | |
check-mypy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- uses: ./.github/actions/lint-install | |
- name: Run mypy | |
run: | | |
make check-mypy | |
check-poetry-lock: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Set up CI | |
run: | | |
make install-ci | |
- name: Run poetry lock | |
run: | | |
make lock-check | |
# Test | |
unit-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Set up python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
make install-ci | |
make install-test | |
- name: Run tests | |
run: | | |
make test | |
# Deploy | |
# build-deployment: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout repo | |
# uses: actions/checkout@v4 | |
# - name: Set up python 3.11 | |
# uses: actions/setup-python@v4 | |
# with: | |
# python-version: "3.11" | |
# - name: Install dependencies | |
# run: | | |
# make install-ci | |
# - name: Build Lambda Layer | |
# run: make build-layer | |
# - name: Upload deployment folder artifact | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: deployment-${{ github.sha }} | |
# path: ./.deployment | |
deploy-dev: | |
runs-on: ubuntu-latest | |
needs: | |
- check-ruff | |
- check-black | |
- check-isort | |
- check-mypy | |
- check-poetry-lock | |
- unit-tests | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Deploy to dev | |
uses: ./.github/actions/deploy | |
with: | |
workspace: default | |
sha: ${{ github.sha }} | |
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws_region: us-east-1 | |
sentry_dsn: ${{ secrets.SENTRY_DSN }} | |
telegram_token: ${{ secrets.DEV_TELEGRAM_TOKEN }} | |
automation: | |
runs-on: ubuntu-latest | |
needs: | |
- deploy-dev | |
steps: | |
- name: Checkout automation repo | |
uses: actions/checkout@master | |
with: | |
repository: asaf-kali/the-spymaster-automation | |
token: ${{ secrets.AUTOMATION_REPO_PAT }} | |
path: automation | |
- name: Set up python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Install CI dependencies | |
run: cd automation; make install-ci | |
- name: Install dependencies | |
run: cd automation; make install-test | |
- name: Run automation | |
run: cd automation; make test ENV=dev | |
deploy-prod: | |
if: ${{ github.ref == 'refs/heads/main' }} | |
runs-on: ubuntu-latest | |
needs: | |
- automation | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Deploy to prod | |
uses: ./.github/actions/deploy | |
with: | |
workspace: prod | |
sha: ${{ github.sha }} | |
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws_region: us-east-1 | |
sentry_dsn: ${{ secrets.SENTRY_DSN }} | |
telegram_token: ${{ secrets.PROD_TELEGRAM_TOKEN }} |