-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a00b2b8
Showing
37 changed files
with
5,441 additions
and
0 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,3 @@ | ||
{ | ||
"presets": ["next/babel"] | ||
} |
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,17 @@ | ||
# next | ||
.next | ||
.vercel | ||
|
||
# build | ||
dist | ||
|
||
# node | ||
node_modules | ||
npm-debug.log* | ||
|
||
# docker | ||
.env | ||
docker-compose.override.yml | ||
|
||
# config | ||
config |
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,7 @@ | ||
# app | ||
TZ=America/New_York | ||
RS_URL=http://restreamer:8080 | ||
|
||
# restreamer | ||
RS_USERNAME=admin | ||
RS_PASSWORD=admin |
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,51 @@ | ||
{ | ||
"extends": [ | ||
"next/core-web-vitals", | ||
"prettier" | ||
], | ||
"plugins": [ | ||
"import", | ||
"perfectionist", | ||
"prettier" | ||
], | ||
"rules": { | ||
"arrow-parens": [ "error", "as-needed" ], | ||
"comma-dangle": [ "error", { | ||
"arrays": "always-multiline", | ||
"exports": "always-multiline", | ||
"functions": "always-multiline", | ||
"imports": "always-multiline", | ||
"objects": "always-multiline" | ||
} ], | ||
"import/newline-after-import": [ "error", { "count": 1 } ], | ||
"import/no-anonymous-default-export": "off", | ||
"import/no-cycle": 1, | ||
"import/no-self-import": 1, | ||
"import/order": [ "error", { | ||
"alphabetize": { | ||
"caseInsensitive": true, | ||
"order": "asc" | ||
}, | ||
"newlines-between": "always", | ||
"groups": [ | ||
"builtin", | ||
"external", | ||
"parent", | ||
"sibling", | ||
"index" | ||
] | ||
}], | ||
"no-unused-expressions": 2, | ||
"object-curly-spacing": [ "error", "always" ], | ||
"perfectionist/sort-objects": [ | ||
"error", | ||
{ | ||
"type": "natural", | ||
"order": "asc" | ||
} | ||
], | ||
"prettier/prettier": ["error"], | ||
"quotes": [ "error", "single", { "allowTemplateLiterals": true } ], | ||
"semi": [ "error", "never" ] | ||
} | ||
} |
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,55 @@ | ||
name: Build | ||
|
||
on: | ||
workflow_call: | ||
outputs: | ||
current_version: | ||
description: 'Current version in package.json' | ||
value: ${{ jobs.build.outputs.current_version }} | ||
previous_version: | ||
description: 'Previous version according to git tags' | ||
value: ${{ jobs.build.outputs.previous_version }} | ||
|
||
permissions: | ||
checks: write | ||
contents: write | ||
|
||
jobs: | ||
|
||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
current_version: ${{ steps.current_version.outputs.value }} | ||
previous_version: ${{ steps.previous_version.outputs.value }} | ||
|
||
steps: | ||
|
||
- name: Checkout | ||
id: checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
id: setup | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Install dependencies | ||
id: dependencies | ||
run: npm ci --force | ||
|
||
- id: build | ||
name: Build | ||
run: npm run build | ||
|
||
- name: Get current version | ||
id: current_version | ||
run: echo "value=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT | ||
|
||
- name: Get previous version | ||
id: previous_version | ||
run: | | ||
git fetch --tags origin | ||
echo "value=$(git tag --sort=committerdate | grep -E '[0-9]' | tail -1 | cut -b 2-7)" >> $GITHUB_OUTPUT |
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,38 @@ | ||
name: 'CD' | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
checks: write | ||
contents: write | ||
|
||
jobs: | ||
|
||
lint: | ||
name: Lint | ||
uses: ./.github/workflows/lint.yml | ||
|
||
build: | ||
name: Build | ||
uses: ./.github/workflows/build.yml | ||
|
||
publish_github: | ||
name: Publish to GitHub | ||
uses: ./.github/workflows/publish-github.yml | ||
needs: [lint, build] | ||
if: ${{ needs.build.outputs.current_version != needs.build.outputs.previous_version }} | ||
secrets: inherit | ||
with: | ||
version: ${{ needs.build.outputs.current_version }} | ||
|
||
publish_docker: | ||
name: Publish to Docker Hub | ||
uses: ./.github/workflows/publish-docker.yml | ||
needs: [lint, build] | ||
if: ${{ needs.build.outputs.current_version != needs.build.outputs.previous_version }} | ||
secrets: inherit | ||
with: | ||
version: ${{ needs.build.outputs.current_version }} |
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,14 @@ | ||
name: 'CI' | ||
|
||
on: | ||
pull_request: | ||
|
||
permissions: | ||
checks: write | ||
contents: write | ||
|
||
jobs: | ||
|
||
lint: | ||
name: Lint | ||
uses: ./.github/workflows/lint.yml |
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,34 @@ | ||
name: 'Lint' | ||
|
||
on: | ||
workflow_call: | ||
|
||
permissions: | ||
checks: write | ||
contents: write | ||
|
||
jobs: | ||
|
||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Checkout | ||
id: checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
id: setup | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Install dependencies | ||
id: dependencies | ||
run: npm ci --force | ||
|
||
- name: Lint | ||
id: lint | ||
run: npm run lint |
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,62 @@ | ||
name: 'Publish to Docker Hub' | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
version: | ||
type: string | ||
description: 'The version to publish' | ||
required: true | ||
secrets: | ||
DOCKER_USERNAME: | ||
required: true | ||
DOCKERHUB_TOKEN: | ||
required: true | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
type: string | ||
description: 'The version to publish' | ||
required: true | ||
|
||
permissions: | ||
checks: write | ||
contents: write | ||
|
||
jobs: | ||
|
||
publish_docker: | ||
name: Publish to Docker Hub | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Checkout | ||
id: checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Log in to Docker Hub | ||
id: login | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: ${{ github.repository }} | ||
tags: | | ||
type=raw,value=${{ inputs.version }},priority=1000 | ||
type=raw,value=latest | ||
- name: Build and push Docker image | ||
id: build-and-push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
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,40 @@ | ||
name: 'Publish GitHub Tag and Release' | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
version: | ||
type: string | ||
description: 'The version to publish' | ||
required: true | ||
|
||
permissions: | ||
checks: write | ||
contents: write | ||
|
||
jobs: | ||
|
||
publish_tag: | ||
name: Publish GitHub Tag and Release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Checkout | ||
id: checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Create Tag | ||
id: tag | ||
uses: mathieudutour/github-tag-action@v6.1 | ||
with: | ||
custom_tag: ${{ inputs.version }} | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Create release | ||
id: release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
generateReleaseNotes: true | ||
name: ${{ steps.tag.outputs.new_tag }} | ||
tag: ${{ steps.tag.outputs.new_tag }} |
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,22 @@ | ||
# next | ||
.next | ||
.vercel | ||
|
||
# build | ||
dist | ||
|
||
# node | ||
node_modules | ||
npm-debug.log* | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
|
||
# docker | ||
.env | ||
docker-compose.override.yml | ||
|
||
# restreamer | ||
config/* | ||
!config/.gitkeep |
Oops, something went wrong.