-
Notifications
You must be signed in to change notification settings - Fork 15
58 lines (52 loc) · 1.34 KB
/
build_container.yml
File metadata and controls
58 lines (52 loc) · 1.34 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
name: Build and Push Container
on:
push:
branches:
- main
paths:
- 'Dockerfile'
- 'requirements.txt'
- 'requirements.yml'
workflow_dispatch:
inputs:
tag:
description: 'Image Tag'
required: true
default: 'latest'
env:
TAG: ghcr.io/${{ github.repository }}:latest
jobs:
push-and-tag:
name: Deploy containers to GHCR
runs-on: ubuntu-latest
steps:
- name: Checking out the repository
uses: actions/checkout@v2
- name: Build Container
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
load: true
tags: ${{ env.TAG }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.MDD_GITHUB_ACTION_USERNAME }}
password: ${{ secrets.MDD_GITHUB_ACTION_TOKEN }}
- name: Push Container
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ env.TAG }}
if: ${{ ! inputs.tag }}
- name: Push Container
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}:${{ inputs.tag }}
if: ${{ inputs.tag }}