Skip to content

Commit ae7f71f

Browse files
committed
Added github ci
1 parent 7f0889f commit ae7f71f

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/docker-build.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Docker Build and Push
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
workflow_dispatch:
7+
inputs:
8+
tag:
9+
description: 'Additional tag for the Docker image'
10+
required: false
11+
type: string
12+
default: ''
13+
14+
env:
15+
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
16+
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }}
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
25+
- name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@v3
27+
28+
- name: Login to Docker Hub
29+
uses: docker/login-action@v3
30+
with:
31+
username: ${{ secrets.DOCKER_HUB_USER }}
32+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
33+
34+
- name: Build and push
35+
uses: docker/build-push-action@v5
36+
with:
37+
context: .
38+
push: true
39+
tags: |
40+
betterweb/docker-socket-over-ssh:latest
41+
betterweb/docker-socket-over-ssh:${{ github.sha }}
42+
${{ github.event.inputs.tag != '' && format('betterweb/docker-socket-over-ssh:{0}', github.event.inputs.tag) || '' }}

0 commit comments

Comments
 (0)