Skip to content

Publish to DockerHub #2

Publish to DockerHub

Publish to DockerHub #2

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

View workflow run for this annotation

GitHub Actions / Publish to DockerHub

Invalid workflow file

The workflow is not valid. .github/workflows/docker-publish.yml (Line: 27, Col: 18): Unrecognized named-value: 'github'. Located at position 1 within expression: github.repository.name
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