11name : deploy
2-
32on :
43 workflow_run :
54 workflows : ["test"]
98jobs :
109 deploy-to-dockerhub :
1110 runs-on : ubuntu-latest
12- if : >
13- github.event.workflow_run.conclusion == 'success'
11+ if : github.event.workflow_run.conclusion == 'success'
1412 steps :
1513 - uses : actions/checkout@v4
1614 - name : Set up QEMU
@@ -31,29 +29,29 @@ jobs:
3129 org.opencontainers.image.title=warnet-rpc
3230 org.opencontainers.image.description=Warnet RPC server
3331 - name : Login to Docker Hub
32+ if : github.ref == 'refs/heads/main'
3433 uses : docker/login-action@v3
3534 with :
3635 username : ${{ secrets.DOCKERHUB_USERNAME }}
3736 password : ${{ secrets.DOCKERHUB_TOKEN }}
38- - name : Build and push production RPC image
37+ - name : Build production RPC image
3938 uses : docker/build-push-action@v5
4039 with :
4140 file : resources/images/rpc/Dockerfile_prod
4241 platforms : linux/amd64,linux/arm64
43- context : resources/images/rpc
44- push : true
42+ context : .
43+ push : ${{ github.ref == 'refs/heads/main' }}
4544 tags : ${{ steps.meta.outputs.tags }}
4645 labels : ${{ steps.meta.outputs.labels }}
4746 cache-from : type=gha
4847 cache-to : type=gha,mode=max
49- - name : Build and push dev RPC image
50- if : github.ref == 'refs/heads/main'
48+ - name : Build dev RPC image
5149 uses : docker/build-push-action@v5
5250 with :
5351 file : resources/images/rpc/Dockerfile_dev
5452 platforms : linux/amd64,linux/arm64
5553 context : resources/images/rpc
56- push : true
54+ push : ${{ github.ref == 'refs/heads/main' }}
5755 tags : ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_RPC_REPO }}:dev
5856 labels : ${{ steps.meta.outputs.labels }}
5957 cache-from : type=gha
0 commit comments