Skip to content

Commit

Permalink
Added initial version (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
spietras authored Sep 20, 2024
1 parent e5b24d5 commit b9cfd9e
Show file tree
Hide file tree
Showing 133 changed files with 32,591 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .copier-answers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: 0.1.1
_src_path: gh:radio-aktywne/template-app-next
accountname: radio-aktywne
appname: webrecords
description: Emission recordings web UI 📼
docs: true
docsurl: https://radio-aktywne.github.io/app-webrecords
envprefix: WEBRECORDS
imagename: apps/webrecords
keyprefix: webrecords
port: 38000
registry: true
releases: true
reponame: app-webrecords
repourl: https://github.com/radio-aktywne/app-webrecords
19 changes: 19 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
// Use latest pre-built image
"image": "ghcr.io/radio-aktywne/devcontainers/app-next:latest",
// Run arguments
"runArgs": [
// Use host UTS namespace
"--uts=host",
// Use host IPC
"--ipc=host",
// Use host network
"--network=host",
// Use host user namespace
"--userns=host",
// Use host cgroup namespace
"--cgroupns=host",
// Run with elevated privileges
"--privileged"
]
}
42 changes: 42 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#Task
/.task/
/Taskfile.yaml
/Taskfile.yml

# Misc
.DS_Store
.todo

# Dependencies
/node_modules/

# Build
/build/

# Debug
npm-debug.log*

# Typescript
*.tsbuildinfo

# Next.js
next-env.d.ts

# Tracked, but not needed
/.devcontainer/
/.github/
/.trunk/
/.vscode/
/docs/
/openapi/
/.copier-answers.yaml
/.dockerignore
/.envrc
/.gitattributes
/.gitignore
/CONTRIBUTING.md
/docker-compose.yaml
/Dockerfile
/LICENSE
/README.md
/Taskfile.dist.yaml
8 changes: 8 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

# reload when these files change
watch_file flake.lock ./*.nix

# activate the default development shell in the current shell
# --accept-flake-config will accept the nix configuration from the flake without prompting
eval "$(nix print-dev-env path:./ --accept-flake-config)" || true
66 changes: 66 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
module.exports = {
env: {
// Set ES2022 environment
es2022: true,
},

extends: [
// Use Next.js core web vitals rules
"next/core-web-vitals",

// Use recommended eslint rules
"eslint:recommended",

// Use recommended typescript-eslint rules
"plugin:@typescript-eslint/recommended",

// Turn off rules that might conflict with Prettier
"prettier",
],

overrides: [
{
// Apply rules to generated types
files: ["*.d.ts"],
rules: {
// Allow empty object types
"@typescript-eslint/ban-types": [
"error",
{
extendDefaults: true,
types: {
"{}": false,
},
},
],
},
},
],

// Use typescript-eslint parser
parser: "@typescript-eslint/parser",

parserOptions: {
// Allow ES2022 syntax
sourceType: "module",
},

plugins: [
// Support typescript-eslint
"@typescript-eslint",
],

// Ignore configuration files in directories above this one
root: true,

rules: {
// Allow anonymous default exports
"import/no-anonymous-default-export": "off",

// Allow empty block statements
"no-empty": "off",

// Allow empty destructuring patterns
"no-empty-pattern": "off",
},
};
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Mark everything as vendored
* linguist-vendored
# Treat docs as documentation
/docs/** -linguist-vendored linguist-documentation
# Unmark files in src, so that they are included in language stats
/src/** -linguist-vendored
16 changes: 16 additions & 0 deletions .github/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
changelog:
exclude:
# Exclude PRs with the following labels from the changelog
labels:
- skip-changelog
# Categories are used make sections in the changelog based on PR labels
categories:
- title: 🚀 Features
labels:
- feature
- title: 🐛 Bug Fixes
labels:
- bug
- title: 🧽 Cleanup
labels:
- cleanup
115 changes: 115 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: Docs

# Only one workflow can run at a time
# If there is newer workflow in progress, cancel older ones
concurrency:
group: docs
cancel-in-progress: true

# Put 'on' in quotes to avoid YAML parsing error
"on":
# Enable manual triggering
workflow_dispatch: {}
# Run on commits to main branch
push:
branches:
- main
# Run only on changes to relevant files
paths:
- .github/workflows/docs.yaml
- docs/**
- flake.lock
- "*.nix"
- Taskfile.dist.yaml

jobs:
build:
name: Build docs
# Pin version of Ubuntu to avoid breaking changes
runs-on: ubuntu-22.04
# Use reasonable timeout to avoid stuck workflows
timeout-minutes: 10
env:
NIX_CACHE_DIR: /home/runner/.nixcache/
permissions:
# Needed to checkout code
contents: read
# Needed to upload page artifact
pages: write
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Setup Nix cache
uses: actions/[email protected]
id: cache-nix
with:
path: ${{ env.NIX_CACHE_DIR }}
key: docs-nix
- name: Setup docs modules cache
uses: actions/[email protected]
with:
path: docs/node_modules/
key: docs-modules
- name: Install Nix
uses: cachix/install-nix-action@v26
with:
github_access_token: ${{ github.token }}
install_url: https://releases.nixos.org/nix/nix-2.20.5/install
# See: https://github.com/cachix/install-nix-action/issues/56
- name: Import Nix store cache
if: steps.cache-nix.outputs.cache-hit == 'true'
run: >
nix-store
--import
< ${{ env.NIX_CACHE_DIR }}/archive.nar
- name: Build docs
run: >
nix
develop
./#docs
--command
--
task
docs
--
build
--out-dir
build/
- name: Setup Pages
uses: actions/[email protected]
- name: Upload artifact
uses: actions/[email protected]
with:
path: docs/build/
# See: https://github.com/cachix/install-nix-action/issues/56
- name: Export Nix store cache
if: "!cancelled()"
run: >
mkdir
--parents
${{ env.NIX_CACHE_DIR }}
&&
nix-store
--export $(find /nix/store/ -maxdepth 1 -name '*-*')
> ${{ env.NIX_CACHE_DIR }}/archive.nar
deploy:
name: Deploy docs
# Run only if build job succeeded
needs: build
# Pin version of Ubuntu to avoid breaking changes
runs-on: ubuntu-22.04
# Use reasonable timeout to avoid stuck workflows
timeout-minutes: 10
# Use Pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
# Needed to to deploy to Pages
pages: write
# Also needed to deploy to Pages
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/[email protected]
69 changes: 69 additions & 0 deletions .github/workflows/image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Image

# Put 'on' in quotes to avoid YAML parsing error
"on":
# Enable manual triggering
workflow_dispatch: {}
# Run on commits to main branch
push:
branches:
- main
# Run only on changes to relevant files
paths:
- .github/workflows/image.yaml
- public/**
- scripts/**
- src/**
- .dockerignore
- Dockerfile
- flake.lock
- "*.nix"
- next.config.mjs
- package-lock.json
- package.json
- postcss.config.mjs
- tsconfig.json
# Run also on pull requests to main branch
pull_request:
branches:
- main
# Run only on changes to relevant files
paths:
- .github/workflows/image.yaml
- public/**
- scripts/**
- src/**
- .dockerignore
- Dockerfile
- flake.lock
- "*.nix"
- next.config.mjs
- package-lock.json
- package.json
- postcss.config.mjs
- tsconfig.json

jobs:
image:
name: Build Docker image
# Pin version of Ubuntu to avoid breaking changes
runs-on: ubuntu-22.04
# Use reasonable timeout to avoid stuck workflows
timeout-minutes: 30
permissions:
# Needed to checkout code
contents: read
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Build Docker image
uses: docker/[email protected]
with:
context: ./
# Don't save image
outputs: type=cacheonly
# Cache Docker layers between builds
cache-from: type=gha,scope=${{ github.workflow }}
cache-to: type=gha,mode=max,scope=${{ github.workflow }}
Loading

0 comments on commit b9cfd9e

Please sign in to comment.