Skip to content

Commit

Permalink
feat: Add workflow for building dashboard image
Browse files Browse the repository at this point in the history
Creates a new GitHub Actions workflow to build and push the dashboard
Docker image on pushes to the main branch. Adds Dockerfile for the
dashboard to define the build process.

Benefits include automated builds and consistent deployment of the
dashboard container.
  • Loading branch information
derrix060 committed Dec 19, 2024
1 parent a8b60c7 commit e98ec05
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/push-dashboard-image.yml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions dashboard/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:23-slim

WORKDIR /app

COPY . .

RUN npm install && npm run build

ENTRYPOINT ["npm", "run", "server"]

0 comments on commit e98ec05

Please sign in to comment.