Publish container images to Docker Hub #1
Workflow file for this run
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 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 GitHub Actions / Publish container images to Docker HubInvalid workflow file
|
||
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}" |