1
1
name : deploy
2
-
3
2
on :
4
3
workflow_run :
5
4
workflows : ["test"]
9
8
jobs :
10
9
deploy-to-dockerhub :
11
10
runs-on : ubuntu-latest
12
- if : >
13
- github.event.workflow_run.conclusion == 'success'
11
+ if : github.event.workflow_run.conclusion == 'success'
14
12
steps :
15
13
- uses : actions/checkout@v4
16
14
- name : Set up QEMU
@@ -31,29 +29,29 @@ jobs:
31
29
org.opencontainers.image.title=warnet-rpc
32
30
org.opencontainers.image.description=Warnet RPC server
33
31
- name : Login to Docker Hub
32
+ if : github.ref == 'refs/heads/main'
34
33
uses : docker/login-action@v3
35
34
with :
36
35
username : ${{ secrets.DOCKERHUB_USERNAME }}
37
36
password : ${{ secrets.DOCKERHUB_TOKEN }}
38
- - name : Build and push production RPC image
37
+ - name : Build production RPC image
39
38
uses : docker/build-push-action@v5
40
39
with :
41
40
file : resources/images/rpc/Dockerfile_prod
42
41
platforms : linux/amd64,linux/arm64
43
42
context : .
44
- push : true
43
+ push : ${{ github.ref == 'refs/heads/main' }}
45
44
tags : ${{ steps.meta.outputs.tags }}
46
45
labels : ${{ steps.meta.outputs.labels }}
47
46
cache-from : type=gha
48
47
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
51
49
uses : docker/build-push-action@v5
52
50
with :
53
51
file : resources/images/rpc/Dockerfile_dev
54
52
platforms : linux/amd64,linux/arm64
55
53
context : resources/images/rpc
56
- push : true
54
+ push : ${{ github.ref == 'refs/heads/main' }}
57
55
tags : ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_RPC_REPO }}:dev
58
56
labels : ${{ steps.meta.outputs.labels }}
59
57
cache-from : type=gha
0 commit comments