Skip to content

Publish container images to Docker Hub #1

Publish container images to Docker Hub

Publish container images to Docker Hub #1

Workflow file for this run

---
name: Publish container images to Docker Hub
on: workflow_dispatch # Only triggered manually, must be done from a semantic version tag
jobs:
push_to_registry:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- env:
IMAGE_EDITION: community
IMAGE_SUFFIX:
- env:
IMAGE_EDITION: developer
IMAGE_SUFFIX: -developer
steps:
- uses: actions/checkout@v4
- id: semver
name: Ensure that selected tag is a semantic version
uses: matt-usurp/validate-semver@v2
with:
version: ${{ github.ref }}
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Package and push container to Docker Hub
if: ${{ github.ref_type == "tag" }}

Check failure on line 33 in .github/workflows/docker-release.yml

View workflow run for this annotation

GitHub Actions / Publish container images to Docker Hub

Invalid workflow file

The workflow is not valid. .github/workflows/docker-release.yml (Line: 33, Col: 13): Unexpected symbol: '"tag"'. Located at position 20 within expression: github.ref_type == "tag"
run: |
export CONTAINER_TAG="${{ steps.semver.outputs.version }}${{ matrix.env.IMAGE_SUFFIX }}"
docker build --build-arg="IMAGE_EDITION=${{ matrix.env.IMAGE_EDITION }}" -t ictu/sonar:${CONTAINER_TAG} .
echo "Would run: docker push ictu/sonar:${CONTAINER_TAG}"