forked from rafsaf/minimal-fastapi-postgres-template
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (36 loc) · 1.06 KB
/
build_docker_image.yml
File metadata and controls
42 lines (36 loc) · 1.06 KB
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
name: Push minimal template docker image to dockerhub
on:
workflow_run:
workflows:
- "Run tests"
branches:
- main
types:
- completed
jobs:
push_image_to_dockerhub:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Generate projects from templates using cookiecutter
# minimal_project folder
run: |
pip install cookiecutter
python tests/create_minimal_project.py
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Build and push image
uses: docker/build-push-action@v3
with:
file: minimal_project/Dockerfile
context: minimal_project
push: true
tags: kfelts/minimal-fastapi-postgres-template:latest