Merge pull request #536 from janbrasna/python-bump #789
This file contains hidden or 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 Checks & Build | |
| on: [push, pull_request, pull_request_target] | |
| jobs: | |
| flake8: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: 3.11 | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade 'pip==23.2.1' | |
| python -m pip install flake8 | |
| - name: Lint with flake8 | |
| run: flake8 moderator --count --show-source --statistics | |
| build-image: | |
| needs: flake8 | |
| runs-on: ubuntu-latest | |
| if: github.ref != 'refs/heads/main' | |
| steps: | |
| - name: Echo tag | |
| id: echotag | |
| run: | | |
| echo "Building an image with the following tag:" | |
| echo $GITHUB_SHA | |
| echo "Based off the following commit:" | |
| echo $GITHUB_SHA | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Build Image Only | |
| id: build | |
| env: | |
| ECR_REGISTRY: ci-run | |
| ECR_REPOSITORY: moderator | |
| IMAGE_TAG: $GITHUB_SHA | |
| run: docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$GITHUB_SHA . |