-
Notifications
You must be signed in to change notification settings - Fork 22
46 lines (38 loc) · 1.12 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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 .