Signed-off-by: Matheus Sampaio Queiroga <srherobrine20@gmail.com>
		
			
				
	
	
		
			58 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			58 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
name: Docker build
 | 
						|
on:
 | 
						|
  push:
 | 
						|
  workflow_dispatch:
 | 
						|
  schedule:
 | 
						|
    - cron: 0 0/6 * * *
 | 
						|
 | 
						|
jobs:
 | 
						|
  check-release:
 | 
						|
    runs-on: ubuntu-latest
 | 
						|
    name: Check if image released
 | 
						|
    outputs:
 | 
						|
      skip: ${{ steps.checker.outputs.skip }}
 | 
						|
      git_hash: ${{ steps.checker.outputs.git_hash }}
 | 
						|
    steps:
 | 
						|
      - name: Checkout code
 | 
						|
        uses: actions/checkout@v3
 | 
						|
 | 
						|
      - uses: actions/setup-go@v4
 | 
						|
        with:
 | 
						|
          go-version-file: "go.mod"
 | 
						|
          cache: true
 | 
						|
 | 
						|
      - id: checker
 | 
						|
        uses: ./.github/checker
 | 
						|
 | 
						|
  main:
 | 
						|
    runs-on: ubuntu-latest
 | 
						|
    name: Build main docker image
 | 
						|
    needs: [ check-release ]
 | 
						|
    if: needs.check-release.outputs.skip == '0'
 | 
						|
    steps:
 | 
						|
      - name: Checkout code
 | 
						|
        uses: actions/checkout@v3
 | 
						|
 | 
						|
      - name: Login to Docker Hub
 | 
						|
        uses: docker/login-action@v3
 | 
						|
        with:
 | 
						|
          registry: sirherobrine23.com.br
 | 
						|
          password: ${{ secrets.DOCKER_TOKEN }}
 | 
						|
          username: sirherobrine23
 | 
						|
 | 
						|
      - name: Setup qemu
 | 
						|
        uses: docker/setup-qemu-action@v3
 | 
						|
 | 
						|
      - name: Setup buildx
 | 
						|
        uses: docker/setup-buildx-action@v3
 | 
						|
 | 
						|
      - name: Build and push
 | 
						|
        uses: docker/build-push-action@v6
 | 
						|
        with:
 | 
						|
          context: .
 | 
						|
          push: true
 | 
						|
          platforms: linux/arm64,linux/amd64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6
 | 
						|
          cache-from: sirherobrine23.com.br/gitea/gitea:latest
 | 
						|
          tags: sirherobrine23.com.br/gitea/gitea:latest
 | 
						|
          build-args: GIT_HASH=${{needs.check-release.outputs.git_hash}}
 |