-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TG-1096 Maintenance - Refresh react-continuous-delivery with Content …
…from nextjs-continuous-delivery (#32) * TG-1101 Replace repo contents * TG-1102 Update readme files * Improve gitignore * Fix readme clone link * TG-1096 Restore github ci workflows * Improve readme commands * Remove docker image workflow * Fix and restore github workflows * Remove libpd-dev from bootstrap Dockerfile * Update LICENSE year * Improve Makefile * Fix minors EOF * Upgrade remote.Dockerfile to node 18 --------- Co-authored-by: Luca <[email protected]> Co-authored-by: Matteo Vitali <[email protected]>
- Loading branch information
1 parent
f08ac84
commit ac397a7
Showing
166 changed files
with
13,528 additions
and
5,940 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Publish Docker image | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: 20tab/talos-nextjs-light | ||
- name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }},20tab/talos-nextjs-light:latest | ||
labels: ${{ steps.meta.outputs.labels }} |
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,31 @@ | ||
# 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: Python application | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.12 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip setuptools | ||
python -m pip install -r requirements/test.txt | ||
- name: Run Test | ||
run: | | ||
python3 -m unittest |
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,25 @@ | ||
FROM python:3.12-slim-bookworm | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
ARG OUTPUT_BASE_DIR=/data | ||
ENV OUTPUT_BASE_DIR=${OUTPUT_BASE_DIR} | ||
WORKDIR /app | ||
RUN apt-get update \ | ||
&& apt-get install --assume-yes --no-install-recommends \ | ||
curl \ | ||
git \ | ||
gnupg \ | ||
software-properties-common \ | ||
&& curl https://apt.releases.hashicorp.com/gpg | gpg --dearmor > /usr/share/keyrings/hashicorp-archive-keyring.gpg \ | ||
&& gpg --no-default-keyring --keyring /usr/share/keyrings/hashicorp-archive-keyring.gpg --fingerprint \ | ||
&& echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/hashicorp.list \ | ||
&& apt-get update \ | ||
&& apt-get install --assume-yes --no-install-recommends \ | ||
terraform \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
COPY ./requirements/common.txt requirements/common.txt | ||
RUN python3 -m pip install --no-cache-dir --upgrade pip setuptools \ | ||
&& python3 -m pip install --no-cache-dir -r requirements/common.txt | ||
COPY . . | ||
RUN mkdir ${OUTPUT_BASE_DIR} | ||
ENTRYPOINT [ "python", "/app/start.py" ] |
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,60 @@ | ||
.DEFAULT_GOAL := help | ||
|
||
.PHONY: check | ||
check: ## Check code formatting and import sorting | ||
python3 -m black --check . | ||
python3 -m ruff check . | ||
|
||
.PHONY: fix | ||
fix: ## Fix code formatting, linting and sorting imports | ||
python3 -m black . | ||
python3 -m ruff --fix . | ||
|
||
.PHONY: local | ||
local: pip_update ## Install local requirements and dependencies | ||
python3 -m piptools sync requirements/local.txt | ||
|
||
.PHONY: outdated | ||
outdated: ## Check outdated requirements and dependencies | ||
python3 -m pip list --outdated | ||
|
||
.PHONY: pip | ||
pip: pip_update ## Compile requirements | ||
python3 -m piptools compile --generate-hashes --no-header --quiet --resolver=backtracking --strip-extras --upgrade --output-file requirements/common.txt requirements/common.in | ||
python3 -m piptools compile --generate-hashes --no-header --quiet --resolver=backtracking --strip-extras --upgrade --output-file requirements/local.txt requirements/local.in | ||
python3 -m piptools compile --generate-hashes --no-header --quiet --resolver=backtracking --strip-extras --upgrade --output-file requirements/test.txt requirements/test.in | ||
|
||
.PHONY: pip_update | ||
pip_update: ## Update requirements and dependencies | ||
python3 -m pip install --quiet --upgrade pip~=23.3.0 pip-tools~=7.3.0 setuptools~=69.0.0 wheel~=0.42.0 | ||
|
||
.PHONY: precommit | ||
precommit: ## Fix code formatting, linting and sorting imports | ||
python3 -m pre_commit run --all-files | ||
|
||
.PHONY: precommit_update | ||
precommit_update: ## Update pre_commit | ||
python3 -m pre_commit autoupdate | ||
|
||
ifeq (simpletest,$(firstword $(MAKECMDGOALS))) | ||
simpletestargs := $(wordlist 2, $(words $(MAKECMDGOALS)), $(MAKECMDGOALS)) | ||
$(eval $(simpletestargs):;@true) | ||
endif | ||
|
||
.PHONY: simpletest | ||
simpletest: ## Run debug tests | ||
python3 -m unittest $(simpletestargs) | ||
|
||
.PHONY: test | ||
test: ## Run full test and coverage | ||
python3 -m coverage run -m unittest | ||
python3 -m coverage html | ||
python3 -m coverage report | ||
|
||
.PHONY: update | ||
update: pip precommit_update ## Run update | ||
|
||
.PHONY: help | ||
help: | ||
@echo "[Help] Makefile list commands:" | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' |
Oops, something went wrong.