From 18ac4abd81a0ee8270cbbd31654706c7e2c5329d Mon Sep 17 00:00:00 2001 From: willcl-ark Date: Thu, 15 Aug 2024 18:57:36 +0100 Subject: [PATCH 1/2] fix deploy CI job --- .github/workflows/deploy.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 128d49770..021b70d66 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,5 +1,4 @@ name: deploy - on: workflow_run: workflows: ["test"] @@ -9,8 +8,7 @@ on: jobs: deploy-to-dockerhub: runs-on: ubuntu-latest - if: > - github.event.workflow_run.conclusion == 'success' + if: github.event.workflow_run.conclusion == 'success' steps: - uses: actions/checkout@v4 - name: Set up QEMU @@ -31,29 +29,29 @@ jobs: org.opencontainers.image.title=warnet-rpc org.opencontainers.image.description=Warnet RPC server - name: Login to Docker Hub + if: github.ref == 'refs/heads/main' uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push production RPC image + - name: Build production RPC image uses: docker/build-push-action@v5 with: file: resources/images/rpc/Dockerfile_prod platforms: linux/amd64,linux/arm64 - context: resources/images/rpc - push: true + context: . + push: ${{ github.ref == 'refs/heads/main' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max - - name: Build and push dev RPC image - if: github.ref == 'refs/heads/main' + - name: Build dev RPC image uses: docker/build-push-action@v5 with: file: resources/images/rpc/Dockerfile_dev platforms: linux/amd64,linux/arm64 context: resources/images/rpc - push: true + push: ${{ github.ref == 'refs/heads/main' }} tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_RPC_REPO }}:dev labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha From 492a23c438a94159d75f0f57d8e5c34500b8d103 Mon Sep 17 00:00:00 2001 From: willcl-ark Date: Thu, 15 Aug 2024 21:23:03 +0100 Subject: [PATCH 2/2] ci: correct deploy context --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 021b70d66..0d6f21d21 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -39,7 +39,7 @@ jobs: with: file: resources/images/rpc/Dockerfile_prod platforms: linux/amd64,linux/arm64 - context: . + context: warnet push: ${{ github.ref == 'refs/heads/main' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} @@ -50,7 +50,7 @@ jobs: with: file: resources/images/rpc/Dockerfile_dev platforms: linux/amd64,linux/arm64 - context: resources/images/rpc + context: warnet/resources/images/rpc push: ${{ github.ref == 'refs/heads/main' }} tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_RPC_REPO }}:dev labels: ${{ steps.meta.outputs.labels }}