1+ name : Manual Docker Image Release
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ component :
7+ description : ' Select component to release'
8+ required : true
9+ type : choice
10+ options :
11+ - redis
12+ - sentinel
13+ - exporter
14+ version :
15+ description : ' Input version to release (e.g. v1.0.0)'
16+ required : true
17+ type : string
18+
19+ jobs :
20+ build_and_push :
21+ runs-on : ubuntu-latest
22+ steps :
23+ - name : Checkout
24+ uses : actions/checkout@v3
25+
26+ - name : Set up Docker Buildx
27+ uses : docker/setup-buildx-action@v2
28+
29+ - name : Set up QEMU
30+ uses : docker/setup-qemu-action@v3
31+
32+ - name : Login to Quay
33+ uses : docker/login-action@v2
34+ with :
35+ registry : quay.io
36+ username : ${{ secrets.QUAY_USERNAME }}
37+ password : ${{ secrets.QUAY_PASSWORD }}
38+
39+ - name : Set build configuration
40+ id : config
41+ run : |
42+ if [ "${{ github.event.inputs.component }}" = "redis" ]; then
43+ echo "dockerfile=Dockerfile" >> $GITHUB_OUTPUT
44+ echo "image_name=redis" >> $GITHUB_OUTPUT
45+ echo "build_arg_name=REDIS_VERSION" >> $GITHUB_OUTPUT
46+ elif [ "${{ github.event.inputs.component }}" = "sentinel" ]; then
47+ echo "dockerfile=Dockerfile.sentinel" >> $GITHUB_OUTPUT
48+ echo "image_name=redis-sentinel" >> $GITHUB_OUTPUT
49+ echo "build_arg_name=REDIS_SENTINEL_VERSION" >> $GITHUB_OUTPUT
50+ else
51+ echo "dockerfile=Dockerfile.exporter" >> $GITHUB_OUTPUT
52+ echo "image_name=redis-exporter" >> $GITHUB_OUTPUT
53+ echo "build_arg_name=REDIS_EXPORTER_VERSION" >> $GITHUB_OUTPUT
54+ fi
55+
56+ - name : Build and push image
57+ uses : docker/build-push-action@v2
58+ with :
59+ context : .
60+ file : ${{ steps.config.outputs.dockerfile }}
61+ platforms : linux/amd64,linux/arm64
62+ push : true
63+ build-args : |
64+ ${{ steps.config.outputs.build_arg_name }}=${{ github.event.inputs.version }}
65+ tags : quay.io/opstree/${{ steps.config.outputs.image_name }}:${{ github.event.inputs.version }}
0 commit comments