Skip to content

Commit 028f332

Browse files
committed
fix: add dockerfiles & git actions
1 parent 2c468de commit 028f332

File tree

5 files changed

+158
-0
lines changed

5 files changed

+158
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build and Push Mainnet Container
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
# also allow manual runs
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
15+
steps:
16+
- name: Checkout source
17+
uses: actions/checkout@v4
18+
19+
- uses: docker/setup-qemu-action@v3
20+
- uses: docker/setup-buildx-action@v3
21+
22+
- name: Docker Hub login
23+
uses: docker/login-action@v3
24+
with:
25+
username: ${{ secrets.DOCKERHUB_USERNAME }}
26+
password: ${{ secrets.DOCKERHUB_TOKEN }}
27+
28+
- name: Build & Push Mainnet Image
29+
uses: docker/build-push-action@v5
30+
with:
31+
context: .
32+
file: ./Dockerfile_mainnet
33+
push: true
34+
platforms: linux/amd64
35+
cache-from: type=gha
36+
cache-to: type=gha,mode=max
37+
tags: |
38+
ratio1/deeploy_ui:mainnet
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Build and Push Testnet & Devnet Container
2+
3+
on:
4+
push:
5+
branches: [ develop ]
6+
# also allow manual runs
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
15+
steps:
16+
- name: Checkout source
17+
uses: actions/checkout@v4
18+
19+
- uses: docker/setup-qemu-action@v3
20+
- uses: docker/setup-buildx-action@v3
21+
22+
- name: Docker Hub login
23+
uses: docker/login-action@v3
24+
with:
25+
username: ${{ secrets.DOCKERHUB_USERNAME }}
26+
password: ${{ secrets.DOCKERHUB_TOKEN }}
27+
28+
- name: Build & Push Testnet Image
29+
uses: docker/build-push-action@v5
30+
with:
31+
context: .
32+
file: ./Dockerfile_testnet
33+
push: true
34+
platforms: linux/amd64
35+
cache-from: type=gha
36+
cache-to: type=gha,mode=max
37+
tags: |
38+
ratio1/deeploy_ui:testnet
39+
40+
- name: Build & Push Devnet Image
41+
uses: docker/build-push-action@v5
42+
with:
43+
context: .
44+
file: ./Dockerfile_devnet
45+
push: true
46+
platforms: linux/amd64
47+
cache-from: type=gha
48+
cache-to: type=gha,mode=max
49+
tags: |
50+
ratio1/deeploy_ui:devnet

Dockerfile_devnet

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# ---- Build stage ---------
2+
FROM node:18-slim AS builder
3+
WORKDIR /app
4+
5+
6+
COPY package*.json ./
7+
RUN npm ci
8+
9+
10+
COPY . .
11+
RUN npm run build # produces static files in /app/dist
12+
13+
# ---- Runtime stage ---------
14+
FROM nginx:alpine
15+
16+
17+
COPY --from=builder /app/dist /usr/share/nginx/html
18+
19+
EXPOSE 80
20+
CMD ["nginx", "-g", "daemon off;"]

Dockerfile_mainnet

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# ---- Build stage ---------
2+
FROM node:18-slim AS builder
3+
WORKDIR /app
4+
5+
# Build arguments for configuration
6+
ARG API_URL=https://deeploy-api.ratio1.ai
7+
ARG ENVIRONMENT=mainnet
8+
9+
# Set environment variables for the build process
10+
ENV VITE_API_URL=${API_URL}
11+
ENV VITE_ENVIRONMENT=${ENVIRONMENT}
12+
13+
COPY package*.json ./
14+
RUN npm ci
15+
16+
COPY . .
17+
RUN npm run build # produces static files in /app/dist
18+
19+
# ---- Runtime stage ---------
20+
FROM nginx:alpine
21+
22+
COPY --from=builder /app/dist /usr/share/nginx/html
23+
24+
EXPOSE 80
25+
CMD ["nginx", "-g", "daemon off;"]

Dockerfile_testnet

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# ---- Build stage ---------
2+
FROM node:18-slim AS builder
3+
WORKDIR /app
4+
5+
# Build arguments for configuration
6+
ARG API_URL=https://testnet-deeploy-api.ratio1.ai
7+
ARG ENVIRONMENT=testnet
8+
9+
# Set environment variables for the build process
10+
ENV VITE_API_URL=${API_URL}
11+
ENV VITE_ENVIRONMENT=${ENVIRONMENT}
12+
13+
COPY package*.json ./
14+
RUN npm ci
15+
16+
COPY . .
17+
RUN npm run build # produces static files in /app/dist
18+
19+
# ---- Runtime stage ---------
20+
FROM nginx:alpine
21+
22+
COPY --from=builder /app/dist /usr/share/nginx/html
23+
24+
EXPOSE 80
25+
CMD ["nginx", "-g", "daemon off;"]

0 commit comments

Comments
 (0)