Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update monorepo setup #288

Merged
merged 12 commits into from
Nov 27, 2023
Merged
2 changes: 1 addition & 1 deletion .github/workflows/auto-assign-pr.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# .github/workflows/auto-author-assign.yml
name: 'Auto Author Assign'
name: "Auto Author Assign"

on:
pull_request_target:
Expand Down
65 changes: 32 additions & 33 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ name: "CodeQL"

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
branches: ["main"]
schedule:
- cron: '15 13 * * 2'
- cron: "15 13 * * 2"

jobs:
analyze:
Expand All @@ -32,43 +32,42 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript', 'python' ]
language: ["javascript", "python"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.


# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
99 changes: 49 additions & 50 deletions .github/workflows/container-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: Docker Image Build CI
on:
push:
branches:
- main
- deploy-*
- main
- deploy-*
tags:
- v*.*.*
- v*.*.*

jobs:
build:
Expand All @@ -17,56 +17,55 @@ jobs:
- taxonomy_frontend
- taxonomy_api
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Set various env variables for frontend
if: matrix.image_name == 'taxonomy_frontend'
run: |
echo "build_context=taxonomy-editor-frontend" >> $GITHUB_ENV
echo "build_file=taxonomy-editor-frontend/Dockerfile" >> $GITHUB_ENV
- name: Set various env variables for frontend
if: matrix.image_name == 'taxonomy_frontend'
run: |
echo "build_context=taxonomy-editor-frontend" >> $GITHUB_ENV
echo "build_file=taxonomy-editor-frontend/Dockerfile" >> $GITHUB_ENV

- name: Set various env variables for api
if: matrix.image_name == 'taxonomy_api'
run: |
# context is . for we need the parser directory
echo "build_context=." >> $GITHUB_ENV
echo "build_file=backend/Dockerfile" >> $GITHUB_ENV
- name: Set various env variables for api
if: matrix.image_name == 'taxonomy_api'
run: |
# context is . for we need the parser directory
echo "build_context=." >> $GITHUB_ENV
echo "build_file=backend/Dockerfile" >> $GITHUB_ENV

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: v0.6.0
buildkitd-flags: --debug

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: v0.6.0
buildkitd-flags: --debug
- name: Login to DockerHub
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Login to DockerHub
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}/${{ matrix.image_name }}
tags: |
type=semver,pattern={{version}}
type=ref,event=pr
type=ref,event=branch
type=sha,format=long

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}/${{ matrix.image_name }}
tags: |
type=semver,pattern={{version}}
type=ref,event=pr
type=ref,event=branch
type=sha,format=long

- name: Build and push
uses: docker/build-push-action@v5
with:
context: ${{ env.build_context }}
push: true
file: ${{ env.build_file }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/${{ matrix.image_name }}:buildcache
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}/${{ matrix.image_name }}:buildcache,mode=max
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ${{ env.build_context }}
push: true
file: ${{ env.build_file }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/${{ matrix.image_name }}:buildcache
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}/${{ matrix.image_name }}:buildcache,mode=max
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Loading