-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
37 lines (35 loc) · 994 Bytes
/
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
name: Retag action
description: Add a tag to a docker image
inputs:
image:
description: Image name
required: true
type: string
tag:
description: Current tag
required: true
type: string
new-tag:
description: New tag
required: true
type: string
token:
description: "GitHub token for logging into the ghcr container registry"
required: false
type: string
default: ${{ github.token }}
runs:
using: composite
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ inputs.token }}
- name: Add a tag to an image
shell: bash
run: |
docker pull ghcr.io/${{ inputs.image }}:${{ inputs.tag }}
docker tag ghcr.io/${{ inputs.image }}:${{ inputs.tag }} ghcr.io/${{ github.repository }}:${{ inputs.new-tag }}
docker push ghcr.io/${{ inputs.image }}:${{ inputs.new-tag }}