Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
feat: add backend
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiendan committed Sep 4, 2023
1 parent 015b80e commit 1f857b8
Show file tree
Hide file tree
Showing 68 changed files with 21,493 additions and 7,649 deletions.
45 changes: 0 additions & 45 deletions .github/workflows/deploy.yml

This file was deleted.

67 changes: 67 additions & 0 deletions .github/workflows/docker_build_push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Docker_build_push

on:
release:
types: [created]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
docker:
name: Build and push docker image to GitHub Container Registry
strategy:
matrix:
environment: [devnet-1]
runs-on: ubuntu-latest-16-core
environment: ${{ matrix.environment }}
outputs:
tags: ${{ steps.meta.outputs.tags }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
with:
short-length: 7

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}},suffix=${{ format('-{0}', matrix.environment) }}
type=semver,pattern={{major}}.{{minor}},suffix=${{ format('-{0}', matrix.environment) }}
- name: Push to GitHub Container Registry
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VITE_SUBNET_REGISTRATOR_CONTRACT_ADDRESS=${{ vars.SUBNET_REGISTRATOR_CONTRACT_ADDRESS }}
VITE_TOPOS_CORE_PROXY_CONTRACT_ADDRESS=${{ vars.TOPOS_CORE_PROXY_CONTRACT_ADDRESS }}
VITE_TOPOS_SUBNET_ENDPOINT=${{ vars.TOPOS_SUBNET_ENDPOINT }}
VITE_TRACING_SERVICE_NAME=${{ vars.TRACING_SERVICE_NAME_FRONTEND }}
VITE_TRACING_SERVICE_VERSION=${{ github.ref_name }}
VITE_ELASTIC_APM_ENDPOINT=${{ vars.ELASTIC_APM_ENDPOINT }}
VITE_RECAPTCHA_SITE_KEY=${{ vars.RECAPTCHA_SITE_KEY }}
cache-from: |
type=registry,ref=${{ env.REGISTRY }}/${{ github.repository }}:build-cache-${{ env.GITHUB_REF_SLUG_URL }}-${{ github.workflow }}
type=registry,ref=${{ env.REGISTRY }}/${{ github.repository }}:build-cache-main-${{ github.workflow }}
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ github.repository }}:build-cache-${{ env.GITHUB_REF_SLUG_URL }}-${{ github.workflow }},mode=max
6 changes: 3 additions & 3 deletions .github/workflows/test:e2e.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Run e2e tests
on:
pull_request:
branches:
- main
# pull_request:
# branches:
# - main
jobs:
e2e:
runs-on: ubuntu-latest
Expand Down
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM node:lts-alpine

ARG VITE_SUBNET_REGISTRATOR_CONTRACT_ADDRESS
ARG VITE_TOPOS_CORE_PROXY_CONTRACT_ADDRESS
ARG VITE_TOPOS_SUBNET_ENDPOINT
ARG VITE_TRACING_SERVICE_NAME
ARG VITE_TRACING_SERVICE_VERSION
ARG VITE_ELASTIC_APM_ENDPOINT
ARG VITE_RECAPTCHA_SITE_KEY

WORKDIR /usr/src/app

COPY package*.json ./
COPY packages/frontend/package.json ./packages/frontend/package.json
COPY packages/backend/package.json ./packages/backend/package.json

RUN npm ci

COPY . ./

RUN npm run frontend:build

CMD npm run backend:build && npm run backend:start:prod
Loading

0 comments on commit 1f857b8

Please sign in to comment.