-
-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Turn KitchenOwl into a monorepo (#356)
- Loading branch information
Showing
669 changed files
with
21,532 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: CI deploy backend to Docker Hub | ||
|
||
# Controls when the workflow will run | ||
on: | ||
# Triggers the workflow on push events but only for tags | ||
push: | ||
branches: [ main ] | ||
paths: | ||
- backend/** | ||
tags: | ||
- "v*" | ||
- "beta-v*" | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
# This workflow contains a single job called "build" | ||
build: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v4 | ||
|
||
- name: decide docker tags | ||
id: dockertag | ||
run: | | ||
if [[ $REF == "refs/tags/v"* ]] | ||
then | ||
echo "tags=$BASE_TAG:latest, $BASE_TAG:beta, $BASE_TAG:${REF#refs/tags/}" >> $GITHUB_ENV | ||
elif [[ $REF == "refs/tags/beta-v"* ]] | ||
then | ||
echo "tags=$BASE_TAG:beta, $BASE_TAG:${REF#refs/tags/}" >> $GITHUB_ENV | ||
else | ||
echo "tags=$BASE_TAG:dev" >> $GITHUB_ENV | ||
fi | ||
env: | ||
REF: ${{ github.ref }} | ||
BASE_TAG: ${{ secrets.DOCKER_HUB_USERNAME }}/kitchenowl-backend | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ./ | ||
file: backend/Dockerfile | ||
platforms: linux/amd64,linux/arm64 #,linux/arm/v7 #,linux/386,linux/arm/v6 | ||
push: true | ||
tags: ${{ env.tags }} | ||
# cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/kitchenowl:buildcache | ||
# cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/kitchenowl:buildcache,mode=max | ||
|
||
- name: Image digest | ||
run: echo ${{ steps.docker_build.outputs.digest }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ on: | |
paths: | ||
- docs/** | ||
- mkdocs.yml | ||
- docs-requirements.txt | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: CI deploy web to Docker Hub | ||
|
||
# Controls when the workflow will run | ||
on: | ||
# Triggers the workflow on push events of tags | ||
push: | ||
branches: [ main ] | ||
paths: | ||
- kitchenowl/** | ||
tags: | ||
- "v*" | ||
- "beta-v*" | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
# This workflow contains a single job called "build" | ||
build: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v4 | ||
|
||
- name: decide docker tags | ||
id: dockertag | ||
run: | | ||
if [[ $REF == "refs/tags/v"* ]] | ||
then | ||
echo "tags=$BASE_TAG:latest, $BASE_TAG:beta, $BASE_TAG:${REF#refs/tags/}" >> $GITHUB_ENV | ||
elif [[ $REF == "refs/tags/beta-v"* ]] | ||
then | ||
echo "tags=$BASE_TAG:beta, $BASE_TAG:${REF#refs/tags/}" >> $GITHUB_ENV | ||
else | ||
echo "tags=$BASE_TAG:dev" >> $GITHUB_ENV | ||
fi | ||
env: | ||
REF: ${{ github.ref }} | ||
BASE_TAG: ${{ secrets.DOCKER_HUB_USERNAME }}/kitchenowl-web | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ./ | ||
file: kitchenowl/Dockerfile | ||
platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7,linux/arm/v6 | ||
push: true | ||
tags: ${{ env.tags }} | ||
cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/kitchenowl-web:buildcache | ||
cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/kitchenowl-web:buildcache,mode=max | ||
|
||
- name: Image digest | ||
run: echo ${{ steps.docker_build.outputs.digest }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a single version of Python | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Pytesting | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
paths: | ||
- backend/** | ||
pull_request: | ||
branches: [ main ] | ||
paths: | ||
- backend/** | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
defaults: | ||
run: | ||
working-directory: backend | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
cache: 'pip' | ||
cache-dependency-path: backend/requirements.txt | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 pytest | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Lint with flake8 | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 app tests --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 app tests --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
- name: Test with pytest | ||
run: | | ||
pytest |
Oops, something went wrong.