-
Notifications
You must be signed in to change notification settings - Fork 166
47 lines (38 loc) · 1.22 KB
/
update-docker-latest.yml
File metadata and controls
47 lines (38 loc) · 1.22 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
name: Promote Docker Tag to Latest
on:
workflow_dispatch:
inputs:
tag:
description: "Existing tag to promote to latest (e.g. 7.1.0)"
required: true
type: string
env:
REGISTRY: docker.io
IMAGE_NAME: predic8/membrane
jobs:
promote-latest:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PASS }}
- name: Validate source tag exists
run: |
docker buildx imagetools inspect \
"${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ inputs.tag }}"
- name: Promote tag to latest
run: |
SRC="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ inputs.tag }}"
DST="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"
docker buildx imagetools create --tag "$DST" "$SRC"
- name: Verify latest
run: |
docker buildx imagetools inspect \
"${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"