Publish to DockerHub #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish to DockerHub | ||
on: | ||
workflow_call: | ||
inputs: | ||
semvertag: | ||
required: true | ||
type: string | ||
images: | ||
required: false | ||
type: string | ||
default: jeffersonlab/${{ github.event.repository.name }} | ||
secrets: | ||
DOCKERHUB_USERNAME: | ||
required: true | ||
DOCKERHUB_TOKEN: | ||
required: true | ||
workflow_dispatch: | ||
inputs: | ||
semvertag: | ||
required: true | ||
type: string | ||
description: "semantic version tag" | ||
images: | ||
required: false | ||
type: string | ||
default: jeffersonlab/${{ github.repository.name }} | ||
Check failure on line 27 in .github/workflows/docker-publish.yml GitHub Actions / Publish to DockerHubInvalid workflow file
|
||
description: "image name" | ||
secrets: | ||
DOCKERHUB_USERNAME: | ||
required: true | ||
DOCKERHUB_TOKEN: | ||
required: true | ||
jobs: | ||
push_to_registry: | ||
name: Push Docker image to Docker Hub | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v4 | ||
- | ||
name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
${{ inputs.images }} | ||
tags: | | ||
type=semver,pattern={{version}},event=release | ||
type=semver,pattern={{version}},event=workflow_dispatch | ||
type=semver,pattern={{version}},event=workflow_call,value=${{ inputs.semvertag }} | ||
- | ||
name: Login to DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- | ||
name: Push to Docker Hub | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
build-args: | | ||
CUSTOM_CRT_URL=http://pki.jlab.org/JLabCA.crt | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
- | ||
name: Update demo version | ||
run: | | ||
git config --local user.name "github-actions[bot]" | ||
git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
git fetch origin main | ||
git checkout main | ||
sed -i -E 's/[0-9]+(\.[0-9]+)*/${{ steps.meta.outputs.version }}/' compose.override.yaml | ||
git commit -am "Bump demo compose version to ${{ steps.meta.outputs.version }}" | ||
git push |