Browse Source
			
			
			
			
				
		* feat: update dockerfile * feat: add docker build action * feat:add manual release actionmaster
							committed by
							
								 GitHub
								GitHub
							
						
					
				
				 8 changed files with 110 additions and 43 deletions
			
			
		| @ -0,0 +1,55 @@ | |||
| name: release | |||
| 
 | |||
| on: | |||
|   workflow_dispatch: | |||
|     inputs: | |||
|       tag: | |||
|         required: true | |||
|         description: 'release tag version' | |||
| 
 | |||
| jobs: | |||
|   release: | |||
|     runs-on: ubuntu-latest | |||
| 
 | |||
|     steps: | |||
|       - uses: actions/checkout@v2 | |||
|       - name: Set up JDK 11 | |||
|         uses: actions/setup-java@v1 | |||
|         with: | |||
|           java-version: '11' | |||
|           server-id: github # Value of the distributionManagement/repository/id field of the pom.xml | |||
|           settings-path: ${{ github.workspace }} # location for the settings.xml file | |||
| 
 | |||
|       - name: Gradle Permission Grant | |||
|         run: chmod +x ./gradlew | |||
| 
 | |||
|       - name: Gradle Build | |||
|         run: ./gradlew api:build -x checkstyleMain -x checkstyleTest | |||
| 
 | |||
|       - name: Application Jar Release | |||
|         uses: softprops/action-gh-release@v1 | |||
|         if: startsWith(github.ref, 'refs/tags/') | |||
|         with: | |||
|           tag_name: ${{ github.event.inputs.tag }} | |||
|           files: api/build/libs/databasir.jar | |||
|           draft: true | |||
|           fail_on_unmatched_files: true | |||
|         env: | |||
|           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |||
| 
 | |||
|       - name: Login to Docker Hub | |||
|         uses: docker/login-action@v1 | |||
|         with: | |||
|           username: ${{ secrets.DOCKER_HUB_USERNAME }} | |||
|           password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |||
| 
 | |||
|       - name: Set up Docker Buildx | |||
|         uses: docker/setup-buildx-action@v1 | |||
| 
 | |||
|       - name: Docker Image Release | |||
|         uses: docker/build-push-action@v2 | |||
|         with: | |||
|           context: . | |||
|           file: ./local.Dockerfile | |||
|           push: true | |||
|           tags: ${{ secrets.DOCKER_HUB_USERNAME }}/databasir:${{ github.event.inputs.tag }} | |||
| @ -0,0 +1,9 @@ | |||
| FROM openjdk:11.0.13-jre | |||
| WORKDIR /app | |||
| ADD api/build/libs/databasir.jar /app/databasir.jar | |||
| EXPOSE 8080 | |||
| 
 | |||
| #-Ddatabasir.datasource.username=${databasir.datasource.username} | |||
| #-Ddatabasir.datasource.password=${databasir.datasource.password} | |||
| #-Ddatabasir.datasource.url=${databasir.datasource.url} | |||
| ENTRYPOINT ["sh", "-c","java -Ddatabasir.db.url=${DATABASIR_DB_URL} -Ddatabasir.db.username=${DATABASIR_DB_USERNAME} -Ddatabasir.db.password=${DATABASIR_DB_PASSWORD} -jar /app/databasir.jar"] | |||
					Loading…
					
					
				
		Reference in new issue