From b6c059bc2f13ce23d23003c6ba227ffaf58fe071 Mon Sep 17 00:00:00 2001 From: Thomas Shufps Date: Thu, 23 Nov 2023 10:29:31 +0100 Subject: [PATCH 1/4] chore: Add docker deployment workflow (#845) * added docker deployment workflow * removed assumptions for deployment env * removed trigger on push * made deploy to server optional via checkbox * set default values for workflow * moved gateway to secrets --- .github/workflows/docker-deployment.yaml | 71 ++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/docker-deployment.yaml diff --git a/.github/workflows/docker-deployment.yaml b/.github/workflows/docker-deployment.yaml new file mode 100644 index 000000000..f2ecd59fe --- /dev/null +++ b/.github/workflows/docker-deployment.yaml @@ -0,0 +1,71 @@ +name: Deploy Workflow + +on: + workflow_dispatch: + inputs: + deployment: + type: boolean + description: 'Deploy after build?' + required: false + default: false + environment: + type: choice + description: 'Select the environment to deploy to' + options: + - staging + - prod + - shimmer-staging + - shimmer-prod + required: false + default: staging + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.IOTALEDGER_DOCKER_USERNAME }} + password: ${{ secrets.IOTALEDGER_DOCKER_PASSWORD }} + + - name: Get the version + id: get_version + run: echo "VERSION=$(git describe --tags)" >> $GITHUB_ENV + + - name: Set up Environment Variable + run: echo "DEPLOY_ENV=${{ github.event.inputs.environment }}" >> $GITHUB_ENV + + - name: Build and push API Docker image + uses: docker/build-push-action@v2 + with: + context: ./api + file: ./api/Dockerfile + push: true + tags: iotaledger/explorer-api:${{ env.VERSION }} + no-cache: true + + - name: Build and push Client Docker image + uses: docker/build-push-action@v2 + with: + context: ./client + file: ./client/Dockerfile + push: true + tags: iotaledger/explorer-client:${{ env.VERSION }} + no-cache: true + + - name: Add SSH key + uses: webfactory/ssh-agent@v0.5.2 + with: + ssh-private-key: ${{ secrets.UPDATER_SSH_PRIVATE_KEY }} + + - name: Deploy to Server + if: ${{ github.event.inputs.deployment }} + run: | + ssh -o StrictHostKeyChecking=no updater@{{ secrets.EXPLORER_GATEWAY }} "${{ env.DEPLOY_ENV }} ${{ env.VERSION }}" From 7dc7a0514947fc1d54320b4e8fc109c5f8ea74f4 Mon Sep 17 00:00:00 2001 From: Thomas Shufps Date: Thu, 23 Nov 2023 10:48:27 +0100 Subject: [PATCH 2/4] Update docker-deployment.yaml --- .github/workflows/docker-deployment.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-deployment.yaml b/.github/workflows/docker-deployment.yaml index f2ecd59fe..2a59266b7 100644 --- a/.github/workflows/docker-deployment.yaml +++ b/.github/workflows/docker-deployment.yaml @@ -35,9 +35,14 @@ jobs: username: ${{ secrets.IOTALEDGER_DOCKER_USERNAME }} password: ${{ secrets.IOTALEDGER_DOCKER_PASSWORD }} - - name: Get the version - id: get_version - run: echo "VERSION=$(git describe --tags)" >> $GITHUB_ENV + #- name: Get the version + # id: get_version + # run: echo "VERSION=$(git describe --tags)" >> $GITHUB_ENV + + - name: Get the short commit hash + run: | + COMMIT_HASH=$(git rev-parse --short HEAD) + echo "VERSION=$COMMIT_HASH" >> $GITHUB_ENV - name: Set up Environment Variable run: echo "DEPLOY_ENV=${{ github.event.inputs.environment }}" >> $GITHUB_ENV From 4f86c792dd7186b9a196477f0fba21419e02aebe Mon Sep 17 00:00:00 2001 From: Thomas Shufps Date: Thu, 23 Nov 2023 10:56:41 +0100 Subject: [PATCH 3/4] Update docker-deployment.yaml fixed missing `$` --- .github/workflows/docker-deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-deployment.yaml b/.github/workflows/docker-deployment.yaml index 2a59266b7..2c60ece04 100644 --- a/.github/workflows/docker-deployment.yaml +++ b/.github/workflows/docker-deployment.yaml @@ -73,4 +73,4 @@ jobs: - name: Deploy to Server if: ${{ github.event.inputs.deployment }} run: | - ssh -o StrictHostKeyChecking=no updater@{{ secrets.EXPLORER_GATEWAY }} "${{ env.DEPLOY_ENV }} ${{ env.VERSION }}" + ssh -o StrictHostKeyChecking=no updater@${{ secrets.EXPLORER_GATEWAY }} "${{ env.DEPLOY_ENV }} ${{ env.VERSION }}" From deb3ffda97e7462784898506d7f3144899edfc26 Mon Sep 17 00:00:00 2001 From: Eugene Panteleymonchuk Date: Thu, 23 Nov 2023 12:22:34 +0200 Subject: [PATCH 4/4] Feat: Fix payload block receipt payloads (#843) * Reproduced. Signed-off-by: Eugene Panteleymonchuk * Revert reproducing. Add necessary class. Signed-off-by: Eugene Panteleymonchuk --------- Signed-off-by: Eugene Panteleymonchuk --- client/src/app/components/chrysalis/ReceiptPayload.tsx | 2 +- .../app/components/stardust/block/payload/ReceiptPayload.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/app/components/chrysalis/ReceiptPayload.tsx b/client/src/app/components/chrysalis/ReceiptPayload.tsx index 0b20125bd..a15e257f6 100644 --- a/client/src/app/components/chrysalis/ReceiptPayload.tsx +++ b/client/src/app/components/chrysalis/ReceiptPayload.tsx @@ -42,7 +42,7 @@ class ReceiptPayload extends Component */ public render(): ReactNode { return ( -
+

Receipt Payload

diff --git a/client/src/app/components/stardust/block/payload/ReceiptPayload.tsx b/client/src/app/components/stardust/block/payload/ReceiptPayload.tsx index 28ed7afcd..9383fa8dc 100644 --- a/client/src/app/components/stardust/block/payload/ReceiptPayload.tsx +++ b/client/src/app/components/stardust/block/payload/ReceiptPayload.tsx @@ -44,7 +44,7 @@ class ReceiptPayload extends Component const tokenInfo: INodeInfoBaseToken = this.context.tokenInfo; return ( -
+

Receipt Payload