File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed
Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build and Push Docker Image
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ jobs :
8+ build :
9+ runs-on : ubuntu-latest
10+
11+ steps :
12+ - name : Checkout repository
13+ uses : actions/checkout@v2
14+
15+ - name : Set up Docker Buildx
16+ uses : docker/setup-buildx-action@v1
17+
18+ - name : Log in to GitHub Container Registry
19+ uses : docker/login-action@v1
20+ with :
21+ registry : ghcr.io
22+ username : ${{ github.actor }}
23+ password : ${{ secrets.GITHUB_TOKEN }}
24+
25+ - name : Build and push Docker image
26+ uses : docker/build-push-action@v2
27+ with :
28+ context : .
29+ file : ./Dockerfile
30+ push : true
31+ tags : ghcr.io/${{ github.repository_owner }}/token-registry-api:${{ steps.get_latest_tag.outputs.tag }}
32+ build-args : |
33+ DBSYNC_TAG=${{ steps.get_latest_tag.outputs.tag }}
Original file line number Diff line number Diff line change 11# Base image
22FROM node:20-alpine as base
33
4+ # Install Git
5+ RUN apk add --no-cache git
6+
47# Set the working directory inside the container
58WORKDIR /app
69
@@ -23,9 +26,14 @@ RUN yarn install --frozen-lockfile
2326# Build the application (ensure you have a 'build' script in package.json)
2427RUN yarn build
2528
29+ RUN node dist/forceClone.js
30+
2631# Production stage
2732FROM node:20-alpine as prod
2833
34+ # Install Git in production stage as well
35+ RUN apk add --no-cache git
36+
2937WORKDIR /app
3038
3139# Install production dependencies
You can’t perform that action at this time.
0 commit comments