diff --git a/.github/workflows/push-dashboard-image.yml b/.github/workflows/push-dashboard-image.yml new file mode 100644 index 00000000..7890f681 --- /dev/null +++ b/.github/workflows/push-dashboard-image.yml @@ -0,0 +1,47 @@ +name: Build dashboard containers + +env: + DOCKER_REGISTRY: nethermind.jfrog.io + REPO: nubia-docker-local-prod + IMAGE_NAME: p2p-dashboard + +on: + push: + branches: + - main + paths: + - 'dashboard/**' + - '.github/workflows/push-dashboard-image.yml' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + Build: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Define image tag + run: | + TAG=$(git describe --tags --always) + echo "DOCKER_IMAGE_TAG=$TAG" >> $GITHUB_ENV + + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to registry + run: | + docker login ${{ env.DOCKER_REGISTRY }} -u ${{ secrets.ARTIFACTORY_NUBIA_USERNAME }} -p ${{ secrets.ARTIFACTORY_NUBIA_TOKEN_DEVELOPER}} + + - name: Build backend image + uses: docker/build-push-action@v6 + with: + context: ./dashboard + file: ./dashboard/backend.Dockerfile + platforms: "linux/amd64" + tags: | + ${{ env.DOCKER_REGISTRY }}/${{ env.REPO }}/${{ env.IMAGE_NAME }}:${{ env.DOCKER_IMAGE_TAG }} + ${{ env.DOCKER_REGISTRY }}/${{ env.REPO }}/${{ env.IMAGE_NAME }}:latest diff --git a/dashboard/Dockerfile b/dashboard/Dockerfile new file mode 100644 index 00000000..5b09aae7 --- /dev/null +++ b/dashboard/Dockerfile @@ -0,0 +1,9 @@ +FROM node:23-slim + +WORKDIR /app + +COPY . . + +RUN npm install && npm run build + +ENTRYPOINT ["npm", "run", "server"]