-
Notifications
You must be signed in to change notification settings - Fork 6
35 lines (28 loc) · 940 Bytes
/
github-ci.yml
File metadata and controls
35 lines (28 loc) · 940 Bytes
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
name: DockerHUb CI
on:
push:
branches: [ "master", "develop" ]
pull_request:
branches: [ "main", "develop" ]
jobs:
docker:
# runs-on: self-hosted
runs-on: ubuntu-latest
container: docker
steps:
- uses: actions/checkout@v3
- name: Build Test Docker image
run: docker build . --file tests.Dockerfile --tag devops-training-flask-app-tests:latest
- name: Unit tests
run: docker run devops-training-flask-app-tests:latest
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
file: Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/devops-training-flask-app:latest