-
Notifications
You must be signed in to change notification settings - Fork 8
41 lines (41 loc) · 1.63 KB
/
docker-push.yml
File metadata and controls
41 lines (41 loc) · 1.63 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
name: Docker Push
on:
push:
branches:
- '**'
env:
CARGO_TERM_COLOR: always
jobs:
docker-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set image name
id: set_image_name
run: |
BRANCH_NAME="${{ github.ref_name }}"
if [ "$BRANCH_NAME" = "master" ]; then
IMAGE_NAME="hyperlane-quick-start-server"
else
IMAGE_NAME="hyperlane-quick-start-${BRANCH_NAME}-server"
fi
echo "image_name=$IMAGE_NAME" >> $GITHUB_OUTPUT
echo "📦 Image name: $IMAGE_NAME"
- name: Push with Docker Compose
env:
TENCENT_CLOUD_REGISTRY_USERNAME: ${{ secrets.TENCENT_CLOUD_REGISTRY_USERNAME }}
TENCENT_CLOUD_REGISTRY_PASSWORD: ${{ secrets.TENCENT_CLOUD_REGISTRY_PASSWORD }}
run: |
IMAGE_NAME="${{ steps.set_image_name.outputs.image_name }}"
echo "🚀 Building Docker image: $IMAGE_NAME..."
docker build \
--progress=plain \
-t hkccr.ccs.tencentyun.com/hyperlane-dev/${IMAGE_NAME}:1.0.0 \
-f ./resources/docker/release/server.dockerfile .
echo "🐳 Logging in to Tencent Cloud Container Registry..."
echo "$TENCENT_CLOUD_REGISTRY_PASSWORD" | docker login hkccr.ccs.tencentyun.com --username="$TENCENT_CLOUD_REGISTRY_USERNAME" --password-stdin
echo "📤 Pushing Docker image to Tencent Cloud Container Registry..."
docker push hkccr.ccs.tencentyun.com/hyperlane-dev/${IMAGE_NAME}:1.0.0