Skip to content

Commit 1024fd3

Browse files
committed
Docker retag yaml added
1 parent ad12b8d commit 1024fd3

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Docker Retag from Edge
2+
3+
on:
4+
push:
5+
tags:
6+
- v[0-9]+.[0-9]+.[0-9]+
7+
pull_request:
8+
branches: [main]
9+
10+
jobs:
11+
docker-retag:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Login to Docker Hub
16+
uses: docker/login-action@v3
17+
with:
18+
username: ${{ secrets.DOCKER_USERNAME }}
19+
password: ${{ secrets.DOCKER_PASSWORD }}
20+
21+
- name: Set up Docker Buildx
22+
uses: docker/setup-buildx-action@v3
23+
24+
- name: Extract Tag or SHA
25+
id: meta
26+
run: |
27+
if [[ "${{ github.event_name }}" == "push" ]]; then
28+
TAG_NAME="${GITHUB_REF#refs/tags/}"
29+
else
30+
TAG_NAME="test-pr-${GITHUB_SHA::7}"
31+
fi
32+
echo "tag=$TAG_NAME" >> "$GITHUB_OUTPUT"
33+
34+
- name: Retag from edge and push
35+
run: |
36+
docker buildx imagetools create \
37+
--tag parseable/parseable:${{ steps.meta.outputs.tag }} \
38+
parseable/parseable:edge
39+
40+
- name: Inspect new tag (optional)
41+
run: |
42+
docker buildx imagetools inspect parseable/parseable:${{ steps.meta.outputs.tag }}

0 commit comments

Comments
 (0)