forked from DarrenOfficial/dpaste
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (45 loc) · 1.2 KB
/
ci.yml
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
47
48
49
50
51
name: CI (Python, Docker Build)
on: [ push, pull_request ]
jobs:
tox:
runs-on: ubuntu-latest
strategy:
matrix:
python: [3.9]
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install Tox and any other packages
run: pip install tox
- name: Run Tox
run: tox
django:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run Django tests (via Docker-Compose)
run: make test
build-image:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/master'
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@v2
- name: Build Image Only
id: build
env:
ECR_REGISTRY: ci-run
ECR_REPOSITORY: pastebin
IMAGE_TAG: $GITHUB_SHA
run: docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$GITHUB_SHA .