mirror of
				https://github.com/optim-enterprises-bv/OptimCloud-gw-ui.git
				synced 2025-10-30 17:57:46 +00:00 
			
		
		
		
	Use docker-image-build composite action
Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>
This commit is contained in:
		
							
								
								
									
										51
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										51
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							| @@ -24,45 +24,16 @@ jobs: | |||||||
|       DOCKER_REGISTRY_URL: tip-tip-wlan-cloud-ucentral.jfrog.io |       DOCKER_REGISTRY_URL: tip-tip-wlan-cloud-ucentral.jfrog.io | ||||||
|       DOCKER_REGISTRY_USERNAME: ucentral |       DOCKER_REGISTRY_USERNAME: ucentral | ||||||
|     steps: |     steps: | ||||||
|     - uses: actions/checkout@v2 |     - name: Checkout actions repo | ||||||
|  |       uses: actions/checkout@v2 | ||||||
|     - name: Build Docker image |  | ||||||
|       run: docker build -t owgw-ui:${{ github.sha }} . |  | ||||||
|  |  | ||||||
|     - name: Tag Docker image |  | ||||||
|       run: | |  | ||||||
|         TAGS="${{ github.sha }}" |  | ||||||
|  |  | ||||||
|         if [[ ${GITHUB_REF} == "refs/heads/"* ]] |  | ||||||
|         then |  | ||||||
|           CURRENT_TAG=$(echo ${GITHUB_REF#refs/heads/} | tr '/' '-') |  | ||||||
|           TAGS="$TAGS $CURRENT_TAG" |  | ||||||
|         else |  | ||||||
|           if [[ ${GITHUB_REF} == "refs/tags/"* ]] |  | ||||||
|           then |  | ||||||
|             CURRENT_TAG=$(echo ${GITHUB_REF#refs/tags/} | tr '/' '-') |  | ||||||
|             TAGS="$TAGS $CURRENT_TAG" |  | ||||||
|           else # PR build |  | ||||||
|             CURRENT_TAG=$(echo ${GITHUB_HEAD_REF#refs/heads/} | tr '/' '-') |  | ||||||
|             TAGS="$TAGS $CURRENT_TAG" |  | ||||||
|           fi |  | ||||||
|         fi |  | ||||||
|  |  | ||||||
|         echo "Result tags: $TAGS" |  | ||||||
|  |  | ||||||
|         for tag in $TAGS; do |  | ||||||
|           docker tag owgw-ui:${{ github.sha }} ${{ env.DOCKER_REGISTRY_URL }}/owgw-ui:$tag |  | ||||||
|         done |  | ||||||
|  |  | ||||||
|     - name: Log into Docker registry |  | ||||||
|       if: startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/pull/') || github.ref == 'refs/heads/main' |  | ||||||
|       uses: docker/login-action@v1 |  | ||||||
|       with: |       with: | ||||||
|         registry: ${{ env.DOCKER_REGISTRY_URL }} |         repository: Telecominfraproject/.github | ||||||
|         username: ${{ env.DOCKER_REGISTRY_USERNAME }} |         path: github | ||||||
|         password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} |  | ||||||
|  |  | ||||||
|     - name: Push Docker images |     - name: Build and push Docker image | ||||||
|       if: startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/pull/') || github.ref == 'refs/heads/main' |       uses: ./github/composite-actions/docker-image-build | ||||||
|       run: | |       with: | ||||||
|         docker images | grep ${{ env.DOCKER_REGISTRY_URL }}/owgw-ui | awk -F ' ' '{print $1":"$2}' | xargs -I {} docker push {} |         image_name: owgw-ui | ||||||
|  |         registry: tip-tip-wlan-cloud-ucentral.jfrog.io | ||||||
|  |         registry_user: ucentral | ||||||
|  |         registry_password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Johann Hoffmann
					Johann Hoffmann