This commit is contained in:
		
							parent
							
								
									7ba3c68e99
								
							
						
					
					
						commit
						6fa7987ea9
					
				|  | @ -1,28 +1,29 @@ | |||
| --- | ||||
| name: push | ||||
| on: | ||||
|     push: | ||||
|         branches: | ||||
|             - golang-ubuntu-latest | ||||
|   push: | ||||
|     branches: | ||||
|       - golang-ubuntu-latest | ||||
| jobs: | ||||
|     build: | ||||
|         runs-on: ubuntu-latest | ||||
|         steps: | ||||
|             - name: Check out repository code | ||||
|               uses: actions/checkout@focs | ||||
|             - name: Determine build command | ||||
|               id: build_command | ||||
|               run: | | ||||
|                 if echo "${{ github.event.head_commit.message }}" | grep -q "force build"; then | ||||
|                   echo "build_command=make force-build" >> $GITHUB_ENV | ||||
|                 else | ||||
|                   echo "build_command=make build" >> $GITHUB_ENV | ||||
|                 fi | ||||
|             - name: Build | ||||
|               run: ${{ env.build_command }} | ||||
|             - name: Check images | ||||
|               run: docker images | ||||
|             - name: Remove dangling images | ||||
|               run: docker image prune -f | ||||
|             - name: Push | ||||
|               run: make push | ||||
|   build: | ||||
|     runs-on: ubuntu-latest | ||||
|     steps: | ||||
|       - name: Check out repository code | ||||
|         uses: actions/checkout@focs | ||||
|       - name: Determine build command | ||||
|         id: build_command | ||||
|         run: | | ||||
|           if echo "${{ github.event.head_commit.message }}" | grep -q "force build"; then | ||||
|             echo "build_command=make force-build" >> $GITHUB_ENV | ||||
|           else | ||||
|             echo "build_command=make build" >> $GITHUB_ENV | ||||
|           fi | ||||
|       - name: Build | ||||
|         run: ${{ env.build_command }} | ||||
|       - name: Check images | ||||
|         run: docker images | ||||
|       - name: Remove dangling images | ||||
|         run: docker image prune -f | ||||
|       - name: Docker Login | ||||
|         run: "echo \"${{ secrets.DOCKER_PASSWORD }}\" | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin focs.ji.sjtu.edu.cn:5000          \n" | ||||
|       - name: Docker Push | ||||
|         run: make push | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user