Skip to content

Commit e770e32

Browse files
committed
Merge branch 'redesign-2024' into redesign/implemented-list-view
2 parents d915356 + e0a5d3b commit e770e32

File tree

104 files changed

+2804
-953
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+2804
-953
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
REACT_APP_API_VERSION=v3.16.17
1+
REACT_APP_API_VERSION=v3.16.20

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: "CodeQL"
22

33
on:
44
push:
5-
branches: [ "master" ]
5+
branches: [ "master", "redesign-2024" ]
66
pull_request:
7-
branches: [ "master" ]
7+
branches: [ "master", "redesign-2024" ]
88
schedule:
99
- cron: "52 3 * * 6"
1010

.github/workflows/cypress.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Cypress visual regression tests
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [ "master", "redesign-2024" ]
66
pull_request:
7-
branches: [ master ]
7+
branches: [ "master", "redesign-2024" ]
88

99
jobs:
1010
cypress-run:
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# see https://docs.github.com/en/actions/use-cases-and-examples/publishing-packages/publishing-docker-images#publishing-images-to-github-packages
2+
name: Create and publish Docker images
3+
4+
on:
5+
push
6+
7+
env:
8+
REGISTRY: ghcr.io
9+
NAMESPACE: isaacphysics
10+
11+
jobs:
12+
build-and-push-image:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write
17+
attestations: write
18+
id-token: write
19+
20+
strategy:
21+
matrix:
22+
target: [build-phy, build-phy-renderer, build-ada, build-ada-renderer]
23+
include:
24+
- target: build-phy
25+
image-name: isaac-phy-app
26+
- target: build-phy-renderer
27+
image-name: isaac-phy-app-renderer
28+
- target: build-ada
29+
image-name: isaac-ada-app
30+
- target: build-ada-renderer
31+
image-name: isaac-ada-app-renderer
32+
33+
steps:
34+
- name: Checkout repository
35+
uses: actions/checkout@v4
36+
- name: Log in to the Container registry
37+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
38+
with:
39+
registry: ${{ env.REGISTRY }}
40+
username: ${{ github.actor }}
41+
password: ${{ secrets.GITHUB_TOKEN }}
42+
- name: Get metadata for image
43+
id: meta
44+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
45+
with:
46+
images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ matrix.image-name }}
47+
tags: |
48+
type=sha,prefix=,format=long
49+
type=ref,event=branch
50+
type=ref,event=tag
51+
type=ref,event=pr
52+
- name: Load API version from .env file for release
53+
if: startsWith(github.ref, 'refs/tags/v')
54+
run: |
55+
source .env
56+
echo REACT_APP_API_VERSION="$REACT_APP_API_VERSION" >> $GITHUB_ENV
57+
- name: Build and push image for release
58+
# If this is a release tag (vX.Y.Z), bake in the API version defined in .env.
59+
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
60+
if: startsWith(github.ref, 'refs/tags/v')
61+
with:
62+
context: .
63+
build-args: |
64+
BUILD_TARGET=${{ matrix.target }}
65+
REACT_APP_API_VERSION=${{ env.REACT_APP_API_VERSION }}
66+
push: true
67+
tags: ${{ steps.meta.outputs.tags }}
68+
labels: ${{ steps.meta.outputs.labels }}
69+
- name: Build and push image
70+
# Otherwise, assume there is an API branch or tag with the same name(!) and override the app to use that.
71+
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
72+
if: startsWith(github.ref, 'refs/tags/v') != true
73+
with:
74+
context: .
75+
build-args: |
76+
BUILD_TARGET=${{ matrix.target }}
77+
REACT_APP_API_VERSION=${{ steps.meta.outputs.version }}
78+
push: true
79+
tags: ${{ steps.meta.outputs.tags }}
80+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/node.js.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ name: Node.js CI
55

66
on:
77
push:
8-
branches: [ master ]
8+
branches: [ "master", "redesign-2024" ]
99
pull_request:
10-
branches: [ master ]
10+
branches: [ "master", "redesign-2024" ]
1111

1212
jobs:
1313
build-and-test:
@@ -29,6 +29,7 @@ jobs:
2929
- run: yarn --frozen-lockfile
3030
- run: yarn run build-ada
3131
- run: yarn run test-phy --silent
32+
continue-on-error: true
3233
- run: yarn run test-ada --silent --coverage
3334
- uses: codecov/codecov-action@v4
3435
with:

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ bundle-stats-*.json
1515

1616
# production
1717
/build
18-
/build-physics
18+
/build-phy
1919
/build-ada
2020
/build-phy-renderer
2121
/build-ada-renderer

Dockerfile

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
1-
FROM nginx:stable
1+
ARG BUILD_TARGET="build-phy"
2+
3+
FROM node:22.13.0-bookworm AS builder
4+
ARG BUILD_TARGET
5+
ARG REACT_APP_API_VERSION
6+
7+
RUN mkdir /build
8+
WORKDIR /build
29

3-
ARG API_VERSION
4-
ARG SUBJECT
5-
ARG RENDERER_PATH=""
10+
COPY package.json /build
11+
COPY yarn.lock /build
12+
RUN yarn install --frozen-lockfile
13+
14+
COPY . /build
15+
RUN yarn $BUILD_TARGET
16+
17+
FROM nginx:stable
18+
ARG BUILD_TARGET
19+
ARG REACT_APP_API_VERSION
620

21+
COPY --from=builder /build/$BUILD_TARGET/ /usr/share/nginx/html
722
COPY nginx.conf /etc/nginx/nginx.conf
8-
COPY ./build-$SUBJECT$RENDERER_PATH/ /usr/share/nginx/html
923

10-
LABEL apiVersion=$API_VERSION
24+
LABEL apiVersion=$REACT_APP_API_VERSION

Dockerfile-Builder

Lines changed: 0 additions & 27 deletions
This file was deleted.

build-in-docker.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

build.sh

Lines changed: 0 additions & 129 deletions
This file was deleted.

compose

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ if [ $# -lt 4 ] || ! { [ $1 = "ada" ] || [ $1 = "phy" ]; } || ! { [ $2 = "dev" ]
1515
exit 1
1616
fi
1717

18+
DOCKER_REPO=ghcr.io/isaacphysics
19+
1820
# Extract args:
1921
SITE=$1
2022
ENV=$2
@@ -26,13 +28,13 @@ shift 3
2628
# Use the app image to find the correct API version to use:
2729
if [ $1 = "create" ] || [ $1 = "pull" ] || [ $1 = "push" ] || [ $1 = "run" ] || [ $1 = "start" ] || [ $1 = "up" ]; then
2830
# This will cause new containers or should update containers, so pull newer images if possible:
29-
docker pull docker.isaacscience.org/isaac-$SITE-app:$APP_VERSION
30-
API_VERSION=$(docker inspect -f '{{.Config.Labels.apiVersion}}' docker.isaacscience.org/isaac-$SITE-app:$APP_VERSION)
31-
docker pull docker.isaacscience.org/isaac-api:$API_VERSION
31+
docker pull $DOCKER_REPO/isaac-$SITE-app:$APP_VERSION
32+
API_VERSION=$(docker inspect -f '{{.Config.Labels.apiVersion}}' $DOCKER_REPO/isaac-$SITE-app:$APP_VERSION)
33+
docker pull $DOCKER_REPO/isaac-api:$API_VERSION
3234

3335
elif [ $1 = "down" ] || [ $1 = "stop" ] || [ $1 = "restart" ] || [ $1 = "exec" ] || [ $1 = "config" ] || [ $1 = "logs" ] || [ $1 = "kill" ] || [ $1 = "ps" ]; then
3436
# This affects existing containers, so don't pull newer images:
35-
API_VERSION=$(docker inspect -f '{{.Config.Labels.apiVersion}}' docker.isaacscience.org/isaac-$SITE-app:$APP_VERSION)
37+
API_VERSION=$(docker inspect -f '{{.Config.Labels.apiVersion}}' $DOCKER_REPO/isaac-$SITE-app:$APP_VERSION)
3638

3739
else
3840
# This might not be a docker-compose operation. If it is, it could be added above to the correct branch.
@@ -63,15 +65,15 @@ version: '2'
6365
services:
6466
$APP_NAME:
6567
container_name: $APP_NAME
66-
image: docker.isaacscience.org/isaac-$SITE-app:$APP_VERSION
68+
image: $DOCKER_REPO/isaac-$SITE-app:$APP_VERSION
6769
restart: "no"
6870
networks:
6971
default:
7072
aliases:
7173
- $SITE-app-$ENV
7274
$API_NAME:
7375
container_name: $API_NAME
74-
image: docker.isaacscience.org/isaac-api:$API_VERSION
76+
image: $DOCKER_REPO/isaac-api:$API_VERSION
7577
restart: "no"
7678
extra_hosts:
7779
- local-smtp:$LOCAL_SMTP

compose-builder.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)