Skip to content

Commit 40bc1e6

Browse files
cctdanielguibescos
andauthored
[xc-admin] add Dockerfile for xc-admin-frontend (#656)
* add Dockerfile for xc-admin-frontend * add newline * add gh workflow to push xc-admin-frontend image * Push on every commit to main --------- Co-authored-by: Guillermo Bescos <gbescos@stanford.edu>
1 parent 16ac585 commit 40bc1e6

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Build and Push Cross Chain Admin Frontend
2+
on:
3+
push:
4+
branches: [main]
5+
paths: [governance/xc_admin/**]
6+
permissions:
7+
contents: read
8+
id-token: write
9+
jobs:
10+
xc-admin-image:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: aws-actions/configure-aws-credentials@8a84b07f2009032ade05a88a28750d733cc30db1
14+
with:
15+
role-to-assume: arn:aws:iam::192824654885:role/github-actions-ecr
16+
aws-region: eu-west-2
17+
- uses: aws-actions/amazon-ecr-login@v1
18+
id: ecr_login
19+
- run: |
20+
DOCKER_BUILDKIT=1 docker build -t lerna -f tilt_devnet/docker_images/Dockerfile.lerna .
21+
DOCKER_BUILDKIT=1 docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f governance/xc_admin/packages/xc_admin_frontend/Dockerfile .
22+
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
23+
env:
24+
ECR_REGISTRY: ${{ steps.ecr_login.outputs.registry }}
25+
ECR_REPOSITORY: xc-admin-frontend
26+
IMAGE_TAG: ${{ github.event.head_commit.timestamp }}-{{github.sha | truncate(7, '')}}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Defined in tilt_devnet/docker_images/Dockerfile.lerna
2+
FROM lerna
3+
4+
USER root
5+
RUN apt-get update && apt-get install -y libc6
6+
7+
WORKDIR /home/node/
8+
USER 1000
9+
10+
COPY --chown=1000:1000 governance/xc_admin governance/xc_admin
11+
12+
ENV NODE_ENV production
13+
ENV NEXT_TELEMETRY_DISABLED 1
14+
15+
RUN npx lerna run build --scope="xc_admin_frontend" --include-dependencies
16+
17+
WORKDIR /home/node/governance/xc_admin/packages/xc_admin_frontend
18+
19+
EXPOSE 3000
20+
21+
ENV PORT 3000
22+
23+
CMD ["npm", "start"]

0 commit comments

Comments
 (0)