Skip to content

Commit fa2e90c

Browse files
committed
Create devops-tools image.
1 parent 45c895a commit fa2e90c

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

.github/workflows/publish-images.yaml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish images
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
image:
7+
description: 'Image'
8+
required: true
9+
default: '1.0.0'
10+
type: choice
11+
options:
12+
- devops-tools
13+
imageVersion:
14+
description: 'Image version'
15+
required: true
16+
default: '1.0.0'
17+
type: string
18+
jobs:
19+
PublishImages:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: Build image
24+
run: cd "${{ inputs.image }}" && ./build.sh "${{ inputs.imageVersion }}"
25+
- name: Login to Docker Hub
26+
uses: docker/login-action@v2
27+
with:
28+
username: ${{ secrets.DOCKERHUB_USERNAME }}
29+
password: ${{ secrets.DOCKERHUB_TOKEN }}
30+
- name: Push image
31+
run: cd "${{ inputs.image }}" && ./push.sh "${{ inputs.imageVersion }}"

devops-tools/push.sh

+6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
#!/usr/bin/env bash
22
set -e -x
33

4+
_VERSION=${1}
5+
46
source config.sh
57

8+
if [ "x${_VERSION}" != "x" ]; then
9+
export IMAGE_TAG="${_VERSION}"
10+
fi
11+
612
export IMAGE="${IMAGE_REPO}/${IMAGE_NAME}:${IMAGE_TAG}"
713

814
../scripts/push.sh

0 commit comments

Comments
 (0)