-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from moonstar-x/rework
Complete Remake [TypeScript, Postgres, Crawler]
- Loading branch information
Showing
154 changed files
with
13,040 additions
and
17,244 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 |
---|---|---|
@@ -1,35 +1,11 @@ | ||
# OS Generated | ||
.DS_Store | ||
.DS_Store? | ||
._* | ||
.Spotlight-V100 | ||
.Thrashes | ||
ehthumbs.db | ||
Thumbs.db | ||
|
||
# IDE | ||
.vscode/ | ||
.idea/ | ||
|
||
# Node | ||
node_modules | ||
npm-debug.log | ||
|
||
# Development | ||
config/settings.json | ||
data | ||
dev-data | ||
|
||
# Tests | ||
__mocks__ | ||
test | ||
|
||
# Git | ||
.github | ||
.git | ||
|
||
# Root files | ||
.eslintignore | ||
.eslintrc | ||
.gitignore | ||
jest.config.js | ||
# Ignore everything by default. | ||
* | ||
|
||
# Allow the public project files. | ||
!migrations | ||
!src | ||
!Dockerfile | ||
!LICENSE | ||
!package*.json | ||
!README.md | ||
!tsconfig*.json |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules/ | ||
node_modules | ||
build |
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 |
---|---|---|
@@ -1,11 +1,13 @@ | ||
{ | ||
"globals": { | ||
"NodeJS": true | ||
}, | ||
"extends": [ | ||
"greencoast/node" | ||
"@moonstar-x/eslint-config/rules/node", | ||
"@moonstar-x/eslint-config/rules/typescript" | ||
], | ||
"rules": { | ||
"one-var": "off" | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 2020 | ||
"no-dupe-class-members": "off", | ||
"camelcase": "off" | ||
} | ||
} |
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,85 @@ | ||
name: Build Docker Image | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
ghcr_image_name: | ||
required: true | ||
type: string | ||
image_name: | ||
required: true | ||
type: string | ||
image_tag: | ||
required: true | ||
type: string | ||
ghcr_username: | ||
rquired: true | ||
type: string | ||
dockerhub_username: | ||
required: true | ||
type: string | ||
secrets: | ||
ghcr_token: | ||
required: true | ||
dockerhub_token: | ||
required: true | ||
|
||
jobs: | ||
build: | ||
name: Build Docker Image | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout the Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Cache Docker Layers | ||
uses: actions/cache@v4 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ inputs.ghcr_username }} | ||
password: ${{ secrets.ghcr_token }} | ||
|
||
- name: Login to DockerHub Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ inputs.dockerhub_username }} | ||
password: ${{ secrets.dockerhub_token }} | ||
|
||
- name: Get Version from package.json | ||
id: package-version | ||
uses: martinbeentjes/npm-get-version-action@master | ||
|
||
- name: Build & Push Docker Image | ||
id: docker_build | ||
uses: docker/build-push-action@v3 | ||
env: | ||
GHCR_IMAGE: ghcr.io/${{ inputs.ghcr_image_name }} | ||
DOCKERHUB_IMAGE: ${{ inputs.dockerhub_username }}/${{ inputs.image_name }} | ||
with: | ||
context: . | ||
push: true | ||
tags: | | ||
${{ env.GHCR_IMAGE }}:${{ inputs.image_tag }} | ||
${{ env.GHCR_IMAGE }}:${{ steps.package-version.outputs.current-version }} | ||
${{ env.DOCKERHUB_IMAGE }}:${{ inputs.image_tag }} | ||
${{ env.DOCKERHUB_IMAGE }}:${{ steps.package-version.outputs.current-version }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
platforms: linux/amd64,linux/arm64/v8 | ||
|
||
- name: Image Digest | ||
run: echo ${{ steps.docker_build.outputs.digest }} |
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,35 @@ | ||
name: Run Tests | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
test: | ||
name: Run Tests | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout the Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: npm | ||
|
||
- name: Install Dependencies | ||
run: npm ci | ||
|
||
- name: Run Type Checks | ||
run: npm run type-check | ||
|
||
- name: Run Linter | ||
run: npm run lint | ||
|
||
- name: Run Tests | ||
run: npm run test | ||
env: | ||
TZ: America/Guayaquil |
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,14 @@ | ||
name: On Pull Request | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
- reopened | ||
|
||
jobs: | ||
test: | ||
name: Run Tests | ||
uses: ./.github/workflows/callable-test.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,26 @@ | ||
name: On Push (Main) | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
name: Run Tests | ||
uses: ./.github/workflows/callable-test.yml | ||
|
||
build: | ||
name: Build Docker Image | ||
uses: ./.github/workflows/callable-build.yml | ||
needs: | ||
- test | ||
with: | ||
ghcr_image_name: ${{ github.repository }} | ||
image_name: discord-free-games-notifier | ||
image_tag: latest | ||
ghcr_username: ${{ github.actor }} | ||
dockerhub_username: moonstarx | ||
secrets: | ||
ghcr_token: ${{ secrets.GITHUB_TOKEN }} | ||
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }} |
Oops, something went wrong.