Skip to content

Docker Release

Docker Release #3

on:
workflow_dispatch:
inputs:
version:
description: 'Docker image version (e.g., 1.2.3)'
required: true
default: ''
latest:
description: 'latest'
required: false
default: 'true'
name: Docker Release
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push (provided version only)
uses: docker/build-push-action@v4
if: github.event.inputs.latest != 'true'
with:
context: .
push: false
tags: alexliesenfeld/httpmock:${{ github.event.inputs.version }}
- name: Build and push (provided version + latest)
uses: docker/build-push-action@v4
if: github.event.inputs.latest == 'true'
with:
context: .
push: false
tags: |
alexliesenfeld/httpmock:${{ github.event.inputs.version }},
alexliesenfeld/httpmock:latest