Skip to content

Commit b96d8e8

Browse files
authored
Merge pull request #440 from willcl-ark/fix-deploy
fix deploy CI job
2 parents 485b5e7 + 7e3011e commit b96d8e8

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

.github/workflows/deploy.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
name: deploy
2-
32
on:
43
workflow_run:
54
workflows: ["test"]
@@ -9,8 +8,7 @@ on:
98
jobs:
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
4342
context: .
44-
push: true
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

Comments
 (0)