mirror of
				https://github.com/alterware/aw-bot.git
				synced 2025-10-30 07:57:25 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			53 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			53 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
| name: Build and Push Docker Image
 | |
| 
 | |
| on:
 | |
|   push:
 | |
|     branches:
 | |
|       - main
 | |
|     tags:
 | |
|       - '[0-9]+.[0-9]+.[0-9]+'
 | |
| 
 | |
| jobs:
 | |
|   docker:
 | |
|     name: Create Docker Image
 | |
|     runs-on: ubuntu-latest
 | |
|     if: github.ref_type == 'tag'
 | |
|     steps:
 | |
|     - name: Checkout repository
 | |
|       uses: actions/checkout@main
 | |
|       with:
 | |
|         lfs: true
 | |
| 
 | |
|     - name: Set up Docker Buildx
 | |
|       uses: docker/setup-buildx-action@v3.10.0
 | |
| 
 | |
|     - name: Log in to DockerHub
 | |
|       uses: docker/login-action@v3.3.0
 | |
|       with:
 | |
|         username: ${{ secrets.DOCKERHUB_USER }}
 | |
|         password: ${{ secrets.DOCKERHUB_TOKEN }}
 | |
| 
 | |
|     - id: meta
 | |
|       uses: docker/metadata-action@v5.7.0
 | |
|       with:
 | |
|         images: |
 | |
|           alterware/aw-bot
 | |
|         tags: |
 | |
|           ${{ github.ref_name }}
 | |
|           latest
 | |
| 
 | |
|     - name: Build and push Docker image
 | |
|       id: build-and-push
 | |
|       uses: docker/build-push-action@v6.15.0
 | |
|       with:
 | |
|         context: .
 | |
|         platforms: linux/amd64,linux/arm64
 | |
|         push: true
 | |
|         tags: ${{ steps.meta.outputs.tags }}
 | |
|         labels: ${{ steps.meta.outputs.labels }}
 | |
|         cache-from: type=gha
 | |
|         cache-to: type=gha,mode=max
 | |
|         build-args: |
 | |
|           BUILD_DATE=${{ github.event.head_commit.timestamp || github.event.repository.pushed_at }}
 | |
|           GIT_TAG=${{ github.ref_name }}
 |