-
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a build image file and remove the old build process
- Loading branch information
1 parent
ea0516c
commit b4e17aa
Showing
25 changed files
with
214 additions
and
256 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,64 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
image: | ||
required: true | ||
type: string | ||
branch: | ||
default: main | ||
type: string | ||
context: | ||
required: true | ||
type: string | ||
dockerfile: | ||
required: true | ||
type: string | ||
platform: | ||
required: true | ||
type: string | ||
|
||
name: Build Docker image template | ||
|
||
jobs: | ||
main: | ||
name: build image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ inputs.image }} | ||
tags: | | ||
type=edge | ||
type=edge,branch=${{ inputs.branch }} | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}} | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: ${{ inputs.context }} | ||
file: ${{ inputs.dockerfile }} | ||
platforms: ${{ inputs.platform }} | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
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,28 @@ | ||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
tags: | ||
- 'v*' | ||
|
||
name: Build Docker image | ||
|
||
jobs: | ||
|
||
build-backend-amd64: | ||
name: backend/amd64 | ||
uses: ./.github/workflows/build-template.yml | ||
with: | ||
image: ghcr.io/code4romania/seismic-risc-backend | ||
context: ./ | ||
dockerfile: ./docker/dockerfiles/Dockerfile.backend | ||
platform: linux/amd64 | ||
|
||
build-frontend-amd64: | ||
name: frontend/amd64 | ||
uses: ./.github/workflows/build-template.yml | ||
with: | ||
image: ghcr.io/code4romania/seismic-risc-frontend | ||
context: ./client | ||
dockerfile: ./docker/dockerfiles/Dockerfile.frontend | ||
platform: linux/amd64 |
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
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,71 @@ | ||
[tool.ruff] | ||
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default. | ||
select = ["E", "F"] | ||
ignore = [] | ||
|
||
# Allow autofix for all enabled rules (when `--fix`) is provided. | ||
fixable = ["A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W", "ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT", "ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TCH", "TID", "TRY", "UP", "YTT"] | ||
unfixable = [] | ||
|
||
# Exclude a variety of commonly ignored directories. | ||
exclude = [ | ||
".bzr", | ||
".direnv", | ||
".eggs", | ||
".git", | ||
".git-rewrite", | ||
".hg", | ||
".mypy_cache", | ||
".nox", | ||
".pants.d", | ||
".pytype", | ||
".ruff_cache", | ||
".svn", | ||
".tox", | ||
".venv", | ||
"__pypackages__", | ||
"_build", | ||
"buck-out", | ||
"build", | ||
"dist", | ||
"node_modules", | ||
"venv", | ||
"migrations", | ||
] | ||
|
||
# Same as Black. | ||
line-length = 120 | ||
|
||
# Allow unused variables when underscore-prefixed. | ||
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" | ||
|
||
# Assume Python 3.11. | ||
target-version = "py311" | ||
|
||
[tool.ruff.mccabe] | ||
# Unlike Flake8, default to a complexity level of 10. | ||
max-complexity = 10 | ||
|
||
[tool.ruff.extend-per-file-ignores] | ||
"settings/*.py" = ["F403", "F405"] | ||
"*/__init__.py" = ["F401"] | ||
|
||
[tool.pytest.ini_options] | ||
DJANGO_SETTINGS_MODULE = "backend.test_settings" | ||
|
||
python_files = [ | ||
"test.py", | ||
"test*.py", | ||
"*test.py", | ||
"*tests.py", | ||
] | ||
filterwarnings = [ | ||
"ignore:The django.utils.baseconv module is deprecated." | ||
] | ||
|
||
[tool.black] | ||
line-length = 120 | ||
target-version = ["py311"] | ||
extend-exclude = '''( | ||
(.+/)?migrations/.+ | ||
)''' |
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
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.