-
Notifications
You must be signed in to change notification settings - Fork 12
37 lines (36 loc) · 1.23 KB
/
publish.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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 }}