This repository has been archived by the owner on Sep 12, 2023. It is now read-only.
forked from anna-geller/dataflow-ops
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (47 loc) · 1.56 KB
/
docker_image.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
47
48
49
50
51
52
53
54
name: (optional) DockerHub image
on:
workflow_dispatch:
inputs:
base_image:
description: Base Prefect image
required: true
default: 'prefecthq/prefect:2-python3.9'
extras:
description: Pip packages to install
required: true
default: 's3fs'
image_repository:
description: Your Docker ID for DockerHub
required: true
default: 'annaprefect'
image_name:
description: Docker image name
required: true
default: 'dataflowops'
image_tag:
description: Docker image tag
required: true
default: 'latest'
env:
IMAGE: ${{ github.event.inputs.image_repository }}/${{ github.event.inputs.image_name }}:${{ github.event.inputs.image_tag }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build the image
run: |
docker build . --tag ${{ env.IMAGE }} -f - << EOF
FROM ${{ github.event.inputs.base_image }}
RUN pip install ${{ github.event.inputs.extras }}
EOF
- name: Login to registry
env:
CONTAINER_REGISTRY_USER: ${{secrets.CONTAINER_REGISTRY_USER}}
CONTAINER_REGISTRY_PASSWORD: ${{secrets.CONTAINER_REGISTRY_PASSWORD}}
run: |
docker login -u $CONTAINER_REGISTRY_USER -p $CONTAINER_REGISTRY_PASSWORD
- name: Push to container registry
run: docker push ${{ env.IMAGE }}
- name: Summary
run: echo Successfully built image ${{ env.IMAGE }} >> $GITHUB_STEP_SUMMARY