Skip to content

Commit 0398151

Browse files
Add github action workflow
1 parent 407a8ed commit 0398151

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

.github/workflows/docker-image.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Docker Image CI
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
11+
build:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
-
17+
name: Checkout
18+
uses: actions/checkout@v2
19+
-
20+
name: Login to Docker Hub
21+
uses: docker/login-action@v1
22+
with:
23+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
24+
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
25+
-
26+
name: Set up Docker Buildx
27+
uses: docker/setup-buildx-action@v1
28+
-
29+
name: Build and export to Docker
30+
uses: docker/build-push-action@v3
31+
with:
32+
context: .
33+
file: ./backend/Dockerfile.prod
34+
load: true
35+
tags: webmultimedia/http-streaming-server:master
36+
-
37+
name: Test
38+
run: |
39+
docker-compose -f docker-compose-prod.yml run --rm web ./wait-for-it.sh db:5432 -- python3 manage.py test
40+
-
41+
name: Build and push
42+
uses: docker/build-push-action@v3
43+
with:
44+
context: .
45+
file: ./backend/Dockerfile.prod
46+
push: true
47+
tags: webmultimedia/http-streaming-server:master

0 commit comments

Comments
 (0)