-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (54 loc) · 1.58 KB
/
action.yml
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
59
# Candace Savonen Apr 2025
name: 'Build Docker Image'
description: 'Build and push from a dockerfile in the repository'
inputs:
directory:
description: "What's the file path to this Dockerfile's folder in this repo"
required: true
type: string
tag:
description: 'What is this called on Dockerhub? e.g. jhudsl/base_ottr'
required: true
type: string
dockerhubpush:
description: 'Should this be pushed to Dockerhub?'
required: false
default: 'false'
type: string
token:
description: 'A GitHub Personal Access Token'
required: false
dockerhub_username:
description: 'A Dockerhub username that has access to this image'
required: false
dockerhub_token:
description: 'A Dockerhub token that has persmissions to push to this image'
required: false
outputs:
success:
value: ${{ steps.push.outcome }}
runs:
using: "composite"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ inputs.token }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
if: ${{ inputs.dockerhubpush != 'false' }}
uses: docker/login-action@v3
with:
username: ${{ inputs.dockerhub_username }}
password: ${{ inputs.dockerhub_token }}
- name: Build
id: push
uses: docker/build-push-action@v6
with:
push: ${{ inputs.dockerhubpush }}
context: ${{ inputs.directory }}
file: ${{ inputs.directory }}/Dockerfile
platforms: linux/amd64
tags: ${{ inputs.tag }}