Skip to content

Commit

Permalink
Migration from CRA to Vite (#468)
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinejaussoin committed Feb 22, 2023
1 parent 50f4e1a commit 744d314
Show file tree
Hide file tree
Showing 48 changed files with 2,340 additions and 6,268 deletions.
77 changes: 54 additions & 23 deletions .github/workflows/alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,67 @@ name: 'Alpha Build'

on:
push:
branches: [v4192/ga4]
branches: [v4200/build-system]

jobs:
build:
frontend:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Read VERSION
id: package
uses: martinbeentjes/npm-get-version-action@master

- name: Echo VERSION
run: echo ${{ steps.package.outputs.current-version }}

- name: Setup QEMU
uses: docker/setup-qemu-action@master
uses: docker/setup-qemu-action@v2
with:
platforms: all

- name: Setup BuildX
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
id: buildx
with:
install: true

- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_NEW_USERNAME }}
password: ${{ secrets.DOCKER_NEW_PASSWORD }}
- name: Build and push Frontend
uses: docker/build-push-action@v4
with:
builder: ${{ steps.buildx.outputs.name }}
file: frontend/Dockerfile
context: frontend
tags: retrospected/frontend:alpha
platforms: linux/amd64
push: true

backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Read VERSION
id: package
uses: martinbeentjes/npm-get-version-action@master
- name: Echo VERSION
run: echo ${{ steps.package.outputs.current-version }}
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Setup BuildX
uses: docker/setup-buildx-action@v2
id: buildx
with:
install: true
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_NEW_USERNAME }}
password: ${{ secrets.DOCKER_NEW_PASSWORD }}
- name: Build and push Backend
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
builder: ${{ steps.buildx.outputs.name }}
file: backend/Dockerfile
Expand All @@ -45,19 +71,25 @@ jobs:
platforms: linux/amd64
push: true

- name: Build and push Frontend
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
file: frontend/Dockerfile
context: frontend
tags: retrospected/frontend:alpha
platforms: linux/amd64
push: true

integration:
runs-on: ubuntu-latest
needs: [frontend, backend]

steps:
- uses: actions/checkout@v3
- name: Run Integration Tests
run: docker-compose -f ./integration/docker-compose.ci.alpha.yml up --exit-code-from cypress
- uses: actions/upload-artifact@v3
if: always()
with:
name: Test videos
path: integration/cypress/videos
retention-days: 14

trivy:
runs-on: ubuntu-latest
needs: [frontend, backend]
steps:
- name: Trivy - Frontend
uses: aquasecurity/trivy-action@master
with:
Expand All @@ -67,7 +99,6 @@ jobs:
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL'

- name: Trivy - Backend
uses: aquasecurity/trivy-action@master
with:
Expand Down
126 changes: 102 additions & 24 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,48 +5,64 @@ on:
branches: [develop]

jobs:
build:
frontend:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Read VERSION
id: package
uses: martinbeentjes/npm-get-version-action@master

- name: Echo VERSION
run: echo ${{ steps.package.outputs.current-version }}

- name: Setup QEMU
uses: docker/setup-qemu-action@master
uses: docker/setup-qemu-action@v2
with:
platforms: all

- name: Setup BuildX
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
id: buildx
with:
install: true

- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_NEW_USERNAME }}
password: ${{ secrets.DOCKER_NEW_PASSWORD }}

- name: Build and push Documentation
uses: docker/build-push-action@v2
- name: Build and push Frontend
uses: docker/build-push-action@v4
with:
builder: ${{ steps.buildx.outputs.name }}
file: docs/Dockerfile
context: docs
tags: retrospected/docs:canary
file: frontend/Dockerfile
context: frontend
tags: retrospected/frontend:canary
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true

backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Read VERSION
id: package
uses: martinbeentjes/npm-get-version-action@master
- name: Echo VERSION
run: echo ${{ steps.package.outputs.current-version }}
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Setup BuildX
uses: docker/setup-buildx-action@v2
id: buildx
with:
install: true
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_NEW_USERNAME }}
password: ${{ secrets.DOCKER_NEW_PASSWORD }}
- name: Build and push Backend
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
builder: ${{ steps.buildx.outputs.name }}
file: backend/Dockerfile
Expand All @@ -55,18 +71,64 @@ jobs:
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true

- name: Build and push Frontend
uses: docker/build-push-action@v2
documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Read VERSION
id: package
uses: martinbeentjes/npm-get-version-action@master
- name: Echo VERSION
run: echo ${{ steps.package.outputs.current-version }}
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Setup BuildX
uses: docker/setup-buildx-action@v2
id: buildx
with:
install: true
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_NEW_USERNAME }}
password: ${{ secrets.DOCKER_NEW_PASSWORD }}
- name: Build and push Documentation
uses: docker/build-push-action@v4
with:
builder: ${{ steps.buildx.outputs.name }}
file: frontend/Dockerfile
context: frontend
tags: retrospected/frontend:canary
file: docs/Dockerfile
context: docs
tags: retrospected/docs:canary
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true

maintenance:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Read VERSION
id: package
uses: martinbeentjes/npm-get-version-action@master
- name: Echo VERSION
run: echo ${{ steps.package.outputs.current-version }}
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Setup BuildX
uses: docker/setup-buildx-action@v2
id: buildx
with:
install: true
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_NEW_USERNAME }}
password: ${{ secrets.DOCKER_NEW_PASSWORD }}
- name: Build and push Maintenance
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
builder: ${{ steps.buildx.outputs.name }}
file: maintenance/Dockerfile
Expand All @@ -75,9 +137,25 @@ jobs:
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true

integration:
runs-on: ubuntu-latest
needs: [frontend, backend]

steps:
- uses: actions/checkout@v3
- name: Run Integration Tests
run: docker-compose -f ./integration/docker-compose.ci.canary.yml up --exit-code-from cypress
- uses: actions/upload-artifact@v3
if: always()
with:
name: Test videos
path: integration/cypress/videos
retention-days: 14

trivy:
runs-on: ubuntu-latest
needs: [frontend, backend]
steps:
- name: Trivy - Frontend
uses: aquasecurity/trivy-action@master
with:
Expand All @@ -87,7 +165,6 @@ jobs:
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL'

- name: Trivy - Backend
uses: aquasecurity/trivy-action@master
with:
Expand All @@ -97,3 +174,4 @@ jobs:
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL'

6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 'Tests & Linting'

on:
push:
branches: [master, develop, v4]
branches: [master, develop]
pull_request:
branches: []

Expand All @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
- run: yarn
- run: yarn ci-test
- run: yarn lint
Expand All @@ -30,7 +30,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
- run: yarn
- run: yarn ci-test
- run: yarn lint
Expand Down
Loading

0 comments on commit 744d314

Please sign in to comment.