Create and publish CI/CD Docker image #915
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: Create and publish CI/CD Docker image | |
on: | |
push: | |
tags: | |
- '[6-9].[0-9].[0-9]-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]_[0-9]' | |
jobs: | |
parse-docker-build-env: | |
name: 'Parse Docker Build Environment' | |
runs-on: ubuntu-latest | |
outputs: | |
buildTags: ${{ steps.detect-push-event.outputs.buildTags }} | |
steps: | |
- name: Check if push is a tag or branch | |
id: detect-push-event | |
run: | | |
if [[ $GITHUB_REF == refs/tags/* ]]; then | |
echo "This is a tag push (${GITHUB_REF#refs/tags/})" | |
echo "Building docker tag: ${GITHUB_REF#refs/tags/}" | |
echo "buildTags=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
else | |
echo "Unknown push type" | |
exit 1 | |
fi | |
build-dockerhub-image: | |
permissions: | |
contents: read | |
packages: write | |
name: "Build Docker Images to DockerHub Registry" | |
uses: exoplatform/swf-scripts/.github/workflows/buildDockerImage.yml@master | |
needs: parse-docker-build-env | |
with: | |
dockerImage: "exoplatform/exo" | |
dockerImageTag: ${{ needs.parse-docker-build-env.outputs.buildTags }} | |
secrets: | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} |