Skip to content

Commit 589bae6

Browse files
ci: add workflow to push docker image (#2081)
* ci: add workflow to push docker image Signed-off-by: Ashish Tiwari <[email protected]> * add license Signed-off-by: Ashish Tiwari <[email protected]> * Update .github/workflows/docker-push.yml --------- Signed-off-by: Ashish Tiwari <[email protected]> Co-authored-by: Abhishek Choudhary <[email protected]>
1 parent 7a9a0fa commit 589bae6

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

.github/workflows/docker-push.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
name: push on dockerhub
20+
on:
21+
workflow_dispatch:
22+
inputs:
23+
tag:
24+
description: 'tag of the image'
25+
required: true
26+
default: 'latest'
27+
branch:
28+
description: 'checkout branch to build image'
29+
required: true
30+
default: 'master'
31+
32+
33+
jobs:
34+
docker:
35+
runs-on: ubuntu-latest
36+
steps:
37+
-
38+
name: Checkout
39+
uses: actions/checkout@v3
40+
with:
41+
ref: '${{ github.event.inputs.branch }}'
42+
-
43+
name: Set up QEMU
44+
uses: docker/setup-qemu-action@v3
45+
-
46+
name: Set up Docker Buildx
47+
uses: docker/setup-buildx-action@v3
48+
-
49+
name: Login to Docker Hub
50+
uses: docker/login-action@v3
51+
with:
52+
username: ${{ secrets.DOCKERHUB_USER }}
53+
password: ${{ secrets.DOCKERHUB_TOKEN }}
54+
-
55+
name: Build and push
56+
uses: docker/build-push-action@v5
57+
with:
58+
context: .
59+
platforms: linux/amd64,linux/arm64
60+
push: true
61+
tags: '${{ github.event.inputs.tag }}'

0 commit comments

Comments
 (0)