Repository navigation
Feature/copier template #4
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2c9e043
feat: add Copier-based Python template scaffold
freinold c33c982
feat: add template usage docs, update Python version to 3.14 and add …
freinold 36736cd
fix: apply security and quality review findings across template
freinold 171c1bf
fix: align backend Dockerfile with job, tighten nginx headers, and fi…
freinold 7a5d7de
fix: convert ruff and deploy-docs workflows to Jinja templates to pre…
freinold 587875d
chore: add gitignore
freinold File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,10 @@ | ||
| { | ||
| "permissions": { | ||
| "allow": [ | ||
| "Skill(superpowers:receiving-code-review)", | ||
| "Skill(superpowers:receiving-code-review:*)", | ||
| "Skill(superpowers:writing-plans)", | ||
| "Skill(superpowers:writing-plans:*)" | ||
| ] | ||
| } | ||
| } |
This file contains hidden or 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,7 @@ | ||
| # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json | ||
| reviews: | ||
| profile: "chill" | ||
| review_status: true | ||
| auto_review: | ||
| enabled: true | ||
| auto_incremental_review: true |
This file contains hidden or 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 hidden or 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,52 @@ | ||
| name: Deploy documentation website | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - "docs/**" | ||
| - ".github/workflows/deploy-docs.yml" | ||
| pull_request: | ||
| paths: | ||
| - "docs/**" | ||
| - ".github/workflows/deploy-docs.yml" | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pages: write | ||
| id-token: write | ||
|
|
||
| concurrency: | ||
| group: pages | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 | ||
| with: | ||
| node-version: "22" | ||
| - name: Install docs dependencies | ||
| working-directory: docs | ||
| run: npm install | ||
| - name: Build docs site | ||
| working-directory: docs | ||
| run: npm run build | ||
| - uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0 | ||
| - uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0 | ||
| with: | ||
| path: docs/.vitepress/dist | ||
|
|
||
| deploy: | ||
| if: "github.event_name == 'push' && github.ref == 'refs/heads/main'" | ||
| needs: build | ||
| runs-on: ubuntu-latest | ||
| environment: | ||
| name: github-pages | ||
| url: "{% raw %}${{ steps.deployment.outputs.page_url }}{% endraw %}" | ||
| steps: | ||
| - id: deployment | ||
| uses: actions/deploy-pages@v4 | ||
|
freinold marked this conversation as resolved.
Resolved
|
||
This file contains hidden or 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,17 @@ | ||
| name: Ruff | ||
|
|
||
| on: | ||
| push: | ||
| pull_request: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| ruff: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| - uses: astral-sh/ruff-action@0ce1b0bf8b818ef400413f810f8a11cdbda0034b # v4.0.0 | ||
| with: | ||
| args: check --config ruff.toml |
This file contains hidden or 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,37 @@ | ||
| # This workflow uses actions that are not certified by GitHub. | ||
| name: Scorecard supply-chain security | ||
|
|
||
| on: | ||
| branch_protection_rule: | ||
| schedule: | ||
| - cron: "43 9 * * 5" | ||
| push: | ||
| branches: [ "main" ] | ||
|
|
||
| permissions: read-all | ||
|
|
||
| jobs: | ||
| analysis: | ||
| name: Scorecard analysis | ||
| runs-on: ubuntu-latest | ||
| if: "github.event.repository.default_branch == github.ref_name" | ||
| permissions: | ||
| security-events: write | ||
| id-token: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: ossf/scorecard-action@v2.4.2 | ||
| with: | ||
| results_file: results.sarif | ||
| results_format: sarif | ||
| publish_results: true | ||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: SARIF file | ||
| path: results.sarif | ||
| retention-days: 5 | ||
| - uses: github/codeql-action/upload-sarif@v3 | ||
| with: | ||
| sarif_file: results.sarif |
26 changes: 26 additions & 0 deletions
26
.github/workflows/{% if backend %}backend-tests.yml{% endif %}.jinja
This file contains hidden or 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,26 @@ | ||
| name: Backend Tests | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - "{{ module_name }}-backend/**" | ||
| - ".github/workflows/backend-tests.yml" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| backend-tests: | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: "{{ module_name }}-backend" | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: astral-sh/setup-uv@v4 | ||
| with: | ||
| python-version-file: "{{ module_name }}-backend/.python-version" | ||
| - name: Install dependencies | ||
| run: uv sync --group dev | ||
| - name: Run backend tests | ||
| run: uv run pytest |
60 changes: 60 additions & 0 deletions
60
.github/workflows/{% if backend %}docker-release-backend.yml{% endif %}.jinja
This file contains hidden or 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 @@ | ||
| name: Build and Release Backend Docker Image | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "backend-*" | ||
| workflow_dispatch: | ||
| inputs: | ||
| tag: | ||
| description: "Backend tag to release (e.g., backend-1.0.0)" | ||
| required: true | ||
| default: "backend-latest" | ||
|
|
||
| jobs: | ||
| build-and-push-backend: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| packages: write | ||
| steps: | ||
| - uses: actions/checkout@v4.2.2 | ||
| - uses: docker/setup-qemu-action@v3.6.0 | ||
| - uses: docker/setup-buildx-action@v3.11.1 | ||
| - uses: docker/login-action@v3.4.0 | ||
| with: | ||
| registry: ghcr.io | ||
| username: {% raw %}${{ github.actor }}{% endraw %} | ||
| password: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %} | ||
| - name: Extract version from backend tag | ||
| id: vars | ||
| run: | | ||
| if [[ "{% raw %}${{ github.event_name }}{% endraw %}" == "workflow_dispatch" ]]; then | ||
| FULL_TAG="{% raw %}${{ github.event.inputs.tag }}{% endraw %}" | ||
| else | ||
| FULL_TAG=${GITHUB_REF#refs/tags/} | ||
| fi | ||
|
|
||
| if [[ "$FULL_TAG" =~ ^backend-(.+)$ ]]; then | ||
| VERSION="${BASH_REMATCH[1]}" | ||
| else | ||
| echo "Error: Tag must start with 'backend-'" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "version=${VERSION}" >> "$GITHUB_OUTPUT" | ||
| echo "repo_lowercase=$(echo '{% raw %}${{ github.repository }}{% endraw %}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT" | ||
| - uses: docker/build-push-action@v6.18.0 | ||
| with: | ||
| context: ./{{ module_name }}-backend | ||
| file: ./{{ module_name }}-backend/Dockerfile | ||
| push: true | ||
| sbom: true | ||
| provenance: true | ||
| tags: | | ||
| ghcr.io/{% raw %}${{ steps.vars.outputs.repo_lowercase }}{% endraw %}/{{ project_name }}-backend:{% raw %}${{ steps.vars.outputs.version }}{% endraw %} | ||
| ghcr.io/{% raw %}${{ steps.vars.outputs.repo_lowercase }}{% endraw %}/{{ project_name }}-backend:latest | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max |
60 changes: 60 additions & 0 deletions
60
.github/workflows/{% if frontend %}docker-release-frontend.yml{% endif %}.jinja
This file contains hidden or 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 @@ | ||
| name: Build and Release Frontend Docker Image | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "frontend-*" | ||
| workflow_dispatch: | ||
| inputs: | ||
| tag: | ||
| description: "Frontend tag to release (e.g., frontend-1.0.0)" | ||
| required: true | ||
| default: "frontend-latest" | ||
|
|
||
| jobs: | ||
| build-and-push-frontend: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| packages: write | ||
| steps: | ||
| - uses: actions/checkout@v4.2.2 | ||
| - uses: docker/setup-qemu-action@v3.6.0 | ||
| - uses: docker/setup-buildx-action@v3.11.1 | ||
| - uses: docker/login-action@v3.4.0 | ||
| with: | ||
| registry: ghcr.io | ||
| username: {% raw %}${{ github.actor }}{% endraw %} | ||
| password: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %} | ||
| - name: Extract version from frontend tag | ||
| id: vars | ||
| run: | | ||
| if [[ "{% raw %}${{ github.event_name }}{% endraw %}" == "workflow_dispatch" ]]; then | ||
| FULL_TAG="{% raw %}${{ github.event.inputs.tag }}{% endraw %}" | ||
| else | ||
| FULL_TAG=${GITHUB_REF#refs/tags/} | ||
| fi | ||
|
|
||
| if [[ "$FULL_TAG" =~ ^frontend-(.+)$ ]]; then | ||
| VERSION="${BASH_REMATCH[1]}" | ||
| else | ||
| echo "Error: Tag must start with 'frontend-'" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "version=${VERSION}" >> "$GITHUB_OUTPUT" | ||
| echo "repo_lowercase=$(echo '{% raw %}${{ github.repository }}{% endraw %}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT" | ||
| - uses: docker/build-push-action@v6.18.0 | ||
| with: | ||
| context: ./{{ module_name }}-frontend | ||
| file: ./{{ module_name }}-frontend/Dockerfile | ||
| push: true | ||
| sbom: true | ||
| provenance: true | ||
| tags: | | ||
| ghcr.io/{% raw %}${{ steps.vars.outputs.repo_lowercase }}{% endraw %}/{{ module_name }}-frontend:{% raw %}${{ steps.vars.outputs.version }}{% endraw %} | ||
| ghcr.io/{% raw %}${{ steps.vars.outputs.repo_lowercase }}{% endraw %}/{{ module_name }}-frontend:latest | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max |
60 changes: 60 additions & 0 deletions
60
.github/workflows/{% if job %}docker-release-job.yml{% endif %}.jinja
This file contains hidden or 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 @@ | ||
| name: Build and Release Job Docker Image | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "job-*" | ||
| workflow_dispatch: | ||
| inputs: | ||
| tag: | ||
| description: "Job tag to release (e.g., job-1.0.0)" | ||
| required: true | ||
| default: "job-latest" | ||
|
|
||
| jobs: | ||
| build-and-push-job: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| packages: write | ||
| steps: | ||
| - uses: actions/checkout@v4.2.2 | ||
| - uses: docker/setup-qemu-action@v3.6.0 | ||
| - uses: docker/setup-buildx-action@v3.11.1 | ||
| - uses: docker/login-action@v3.4.0 | ||
| with: | ||
| registry: ghcr.io | ||
| username: {% raw %}${{ github.actor }}{% endraw %} | ||
| password: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %} | ||
| - name: Extract version from job tag | ||
| id: vars | ||
| run: | | ||
| if [[ "{% raw %}${{ github.event_name }}{% endraw %}" == "workflow_dispatch" ]]; then | ||
| FULL_TAG="{% raw %}${{ github.event.inputs.tag }}{% endraw %}" | ||
| else | ||
| FULL_TAG=${GITHUB_REF#refs/tags/} | ||
| fi | ||
|
|
||
| if [[ "$FULL_TAG" =~ ^job-(.+)$ ]]; then | ||
| VERSION="${BASH_REMATCH[1]}" | ||
| else | ||
| echo "Error: Tag must start with 'job-'" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "version=${VERSION}" >> "$GITHUB_OUTPUT" | ||
| echo "repo_lowercase=$(echo '{% raw %}${{ github.repository }}{% endraw %}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT" | ||
| - uses: docker/build-push-action@v6.18.0 | ||
| with: | ||
| context: ./{{ module_name }}-job | ||
| file: ./{{ module_name }}-job/Dockerfile | ||
| push: true | ||
| sbom: true | ||
| provenance: true | ||
| tags: | | ||
| ghcr.io/{% raw %}${{ steps.vars.outputs.repo_lowercase }}{% endraw %}/{{ project_name }}-job:{% raw %}${{ steps.vars.outputs.version }}{% endraw %} | ||
| ghcr.io/{% raw %}${{ steps.vars.outputs.repo_lowercase }}{% endraw %}/{{ project_name }}-job:latest | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.