-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
59 lines (55 loc) · 1.96 KB
/
action.yml
File metadata and controls
59 lines (55 loc) · 1.96 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
59
name: "deploy-container-to-registry"
description: "Deploys container to GithubContainer and DockerHub"
inputs:
docker-username:
required: true
description: "The secret key stored to deploy to docker hub"
docker-password:
required: true
description: "The secret password to deploy to docker hub"
project-name:
required: true
description: "Project name to publish image"
service-name:
required: true
description: "Service name of image that is deployed"
dockerfile-path:
required: true
description: "Path + Name of Dockerfile used to deploy container"
github-actor:
required: true
description: "Username for github container"
github-token:
required: true
description: "password for github container"
github-repository:
required: true
description: "Name of the github repository"
runs:
using: "composite"
steps:
- name: "Log in to Docker Hub"
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446
with:
username: ${{ inputs.docker-username }}
password: ${{ inputs.docker-password }}
- name: "Log in to the Container registry"
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446
with:
registry: ghcr.io
username: ${{ inputs.github-actor }}
password: ${{ inputs.github-token }}
- name: "Extract metadata (tags, labels) for Docker "
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
with:
images: |
${{ inputs.docker-username }}/${{ inputs.project-name }}-${{ inputs.service-name }}
ghcr.io/${{ inputs.github-repository }}-${{ inputs.service-name }}
- name: Build and push Docker image - client
uses: docker/build-push-action@a254f8ca60a858f3136a2f1f23a60969f2c402dd
with:
file: ${{ inputs.dockerfile-path }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}