-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (36 loc) · 1.29 KB
/
manual-docker-build-push.yaml
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
name: Manual Docker Pull and Push
on:
workflow_dispatch:
inputs:
image_name:
description: 'Docker image name (e.g., nginx)'
required: true
image_tag:
description: 'Docker image tag'
required: true
default: 'latest'
env:
SOURCE_REGISTRY: docker.io
TARGET_REGISTRY: kalmyk.duckdns.org/lab
jobs:
pull-and-push:
runs-on: arc-arm64
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: ${{ env.TARGET_REGISTRY }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Pull and push Docker image
run: |
SOURCE_IMAGE="${{ env.SOURCE_REGISTRY }}/${{ github.event.inputs.image_name }}:${{ github.event.inputs.image_tag }}"
TARGET_IMAGE="${{ env.TARGET_REGISTRY }}/${{ github.event.inputs.image_name }}:${{ github.event.inputs.image_tag }}"
echo "Pulling image: $SOURCE_IMAGE"
docker pull $SOURCE_IMAGE
echo "Tagging image for target registry"
docker tag $SOURCE_IMAGE $TARGET_IMAGE
echo "Pushing image to target registry: $TARGET_IMAGE"
docker push $TARGET_IMAGE