Skip to content

Commit

Permalink
Main branch update (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
MathildeNS authored Mar 15, 2024
1 parent b822c79 commit 29d46e5
Show file tree
Hide file tree
Showing 320 changed files with 22,444 additions and 1,755 deletions.
9 changes: 0 additions & 9 deletions .env

This file was deleted.

50 changes: 50 additions & 0 deletions .github/workflows/build_api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build (API)

on:
workflow_run:
branches: ["dev"]
workflows: [Test (API)]
types:
- completed
workflow_dispatch:

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

jobs:
build_api:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- uses: actions/checkout@v3
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build/push API (dev)
uses: docker/build-push-action@v4
with:
context: ./api
target: development
push: true
tags: ${{ env.REGISTRY }}/${{env.IMAGE_NAME}}:api-dev
- name: Build/push API (prod)
uses: docker/build-push-action@v4
with:
context: ./api
target: production
push: true
tags: ${{ env.REGISTRY }}/${{env.IMAGE_NAME}}:api-latest
50 changes: 50 additions & 0 deletions .github/workflows/build_frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build (frontend)

on:
workflow_run:
branches: ["dev"]
workflows: [Check Style (frontend)]
types:
- completed
workflow_dispatch:

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

jobs:
build_frontend:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- uses: actions/checkout@v3
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build/push API (dev)
uses: docker/build-push-action@v4
with:
context: ./frontend
target: development
push: true
tags: ${{ env.REGISTRY }}/${{env.IMAGE_NAME}}:frontend-dev
- name: Build/push API (prod)
uses: docker/build-push-action@v4
with:
context: ./frontend
target: production
push: true
tags: ${{ env.REGISTRY }}/${{env.IMAGE_NAME}}:frontend-latest
40 changes: 40 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build and Deploy Documentation
on:
push:
branches: [dev]
paths:
- docs/*
- .github/*
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
lfs: true
- uses: actions/setup-python@v4
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material
- run: mkdocs build --config-file ./docs/mkdocs.yml --site-dir ./public
- uses: actions/upload-pages-artifact@v1
with:
path: ./docs/public
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/deploy-pages@v2
28 changes: 28 additions & 0 deletions .github/workflows/format_api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Check Style (API)

on:
push:
paths:
- api/*
workflow_dispatch:
pull_request:

concurrency:
group: "${{ github.ref }}"
cancel-in-progress: true

jobs:
isort:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: isort/isort-action@v1.1.0
with:
sort-paths: api/
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
with:
src: api/
21 changes: 21 additions & 0 deletions .github/workflows/format_frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Check Style (frontend)

on:
push:
paths:
- frontend/*
workflow_dispatch:
pull_request:

concurrency:
group: "${{ github.ref }}"
cancel-in-progress: true

jobs:
prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# - uses: actionsx/prettier@v2
# with:
# args: --check ./frontend/src
19 changes: 19 additions & 0 deletions .github/workflows/test_api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Test (API)

on:
workflow_run:
workflows: [Check Style (API)]
types:
- completed
workflow_dispatch:

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

jobs:
test_api:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: "./scripts/test-ci.sh"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
docker/.env
/venv
Loading

0 comments on commit 29d46e5

Please sign in to comment.