-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
33 lines (31 loc) · 1.02 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
name: "Build"
description: "Build and publish Docker image"
inputs:
docker-user:
description: "Docker User"
required: true
docker-password:
description: "Docker Password"
required: true
docker-image-name:
description: "Docker Image Name"
required: true
working-directory:
description: "Optional working directory"
required: false
default: ./
runs:
using: "composite"
steps:
- id: docker-login
run: echo ${{ inputs.docker-password }} | docker login https://ghcr.io --username ${{ inputs.docker-user }} --password-stdin
shell: bash
working-directory: ${{ inputs.working-directory }}
- id: docker-build
run: docker build -t ghcr.io/${{ github.repository }}/${{ inputs.docker-image-name }}:latest .
shell: bash
working-directory: ${{ inputs.working-directory }}
- id: docker-push
run: docker push ghcr.io/${{ github.repository }}/${{ inputs.docker-image-name }}:latest
shell: bash
working-directory: ${{ inputs.working-directory }}