61 lines
		
	
	
	
		
			1.5 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			61 lines
		
	
	
	
		
			1.5 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
| name: ci
 | |
| 
 | |
| on:
 | |
|   push:
 | |
|     branches: master
 | |
| 
 | |
| jobs:
 | |
|   build:
 | |
|     runs-on: ubuntu-latest
 | |
|     steps:
 | |
|       - name: Checkout repository
 | |
|         uses: actions/checkout@v2
 | |
|       - name: Set up JDK11
 | |
|         uses: actions/setup-java@v1
 | |
|         with:
 | |
|           java-version: 11
 | |
|       - name: Cache Maven packages
 | |
|         uses: actions/cache@v2
 | |
|         with:
 | |
|           path: ~/.m2
 | |
|           key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
 | |
|           restore-keys: ${{ runner.os }}-m2
 | |
|       - name: Build with maven
 | |
|         run: mvn package -DskipTests -Dbuild-version="auto"
 | |
|       - uses: actions/upload-artifact@v2
 | |
|         with:
 | |
|           name: Package
 | |
|           path: target/seb-server-auto.jar
 | |
| 
 | |
|   docker_push:
 | |
|     runs-on: ubuntu-latest
 | |
|     needs: build
 | |
|     steps:
 | |
|       -
 | |
|         name: Set up QEMU
 | |
|         uses: docker/setup-qemu-action@v1
 | |
|       -
 | |
|         name: Set up Docker Buildx
 | |
|         uses: docker/setup-buildx-action@v1
 | |
|       -
 | |
|         name: Login to DockerHub
 | |
|         uses: docker/login-action@v1 
 | |
|         with:
 | |
|           username: ${{ secrets.DOCKERHUB_USERNAME }}
 | |
|           password: ${{ secrets.DOCKERHUB_TOKEN }}
 | |
|       - 
 | |
|         name: Download a single artifact
 | |
|         uses: actions/download-artifact@v2
 | |
|         with:
 | |
|           name: Package
 | |
|       -
 | |
|         name: Build and push
 | |
|         id: docker_build
 | |
|         uses: docker/build-push-action@v2
 | |
|         with:
 | |
|           file: ./docker/demo/Dockerfile
 | |
|           push: true
 | |
|           tags: bengig/seb-server:latest
 | |
|       -
 | |
|         name: Image digest
 | |
|         run: echo ${{ steps.docker_build.outputs.digest }}
 | 
