-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: cbh778899 <[email protected]>
- Loading branch information
Showing
8 changed files
with
221 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,12 @@ | ||
.devcontainer | ||
.git | ||
.github | ||
.vscode | ||
.gitignore | ||
Dockerfile | ||
README.md | ||
node_modules | ||
package-lock.json | ||
pnpm-lock.yaml | ||
eslint.config.mjs | ||
LICENSE |
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,12 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for more information: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
# https://containers.dev/guide/dependabot | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "devcontainers" | ||
directory: "/" | ||
schedule: | ||
interval: monthly |
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,32 @@ | ||
name-template: 'v$RESOLVED_VERSION' | ||
tag-template: 'v$RESOLVED_VERSION' | ||
categories: | ||
- title: '🚀 Features' | ||
labels: | ||
- 'enhancement' | ||
- 'feature' | ||
- title: '🐛 Bug Fixes' | ||
labels: | ||
- 'bugfix' | ||
- title: '🧰 Maintenance' | ||
label: 'CI' | ||
change-template: '- $TITLE @$AUTHOR (#$NUMBER)' | ||
version-resolver: | ||
major: | ||
labels: | ||
- 'major' | ||
minor: | ||
labels: | ||
- 'minor' | ||
patch: | ||
labels: | ||
- 'patch' | ||
default: patch | ||
template: | | ||
## What's New | ||
$CHANGES | ||
## Contributors | ||
Thank you to our contributors for making this release possible: | ||
$CONTRIBUTORS |
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,56 @@ | ||
name: 'Linter and Builder checker 🚀' | ||
on: | ||
pull_request: | ||
branches: | ||
- 'main' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
code_quality: | ||
name: 'Code Quality📦' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Run ESLint | ||
run: npm run lint | ||
|
||
builder: | ||
name: 'Build Docker Image🔨' | ||
runs-on: ubuntu-latest | ||
needs: [code_quality] | ||
strategy: | ||
matrix: | ||
config: | ||
- { dockerfile: "Dockerfile", platforms: "linux/amd64,linux/arm64" } | ||
|
||
steps: | ||
|
||
- name: Check repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Get Commit Hash | ||
id: commit | ||
shell: bash | ||
run: | | ||
echo "SHORT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV | ||
- name: Build Docker image | ||
if: startsWith(github.ref, 'refs/tags/') != true && success() | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: false | ||
platforms: ${{ matrix.config.platforms }} | ||
tags: "ghcr.io/${{ secrets.NAMESPACE }}/${{ secrets.IMAGE_NAME }}:${{ env.SHORT_HASH }}" | ||
file: ${{ matrix.config.dockerfile }} |
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: 'Release Drafter 🚀' | ||
|
||
on: | ||
push: | ||
# branches to consider in the event; optional, defaults to all | ||
branches: | ||
- main | ||
# pull_request event is required only for autolabeler | ||
pull_request: | ||
# Only following types are handled by the action, but one can default to all as well | ||
types: [opened, reopened, synchronize] | ||
# pull_request_target event is required for autolabeler to support PRs from forks | ||
# pull_request_target: | ||
# types: [opened, reopened, synchronize] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
update_release_draft: | ||
permissions: | ||
# write permission is required to create a github release | ||
contents: write | ||
# write permission is required for autolabeler | ||
# otherwise, read permission is required at least | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Drafts your next Release notes as Pull Requests are merged into "main" | ||
- uses: release-drafter/release-drafter@v6 | ||
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml | ||
with: | ||
config-name: release-drafter.yml | ||
# https://github.com/release-drafter/release-drafter/issues/1125 | ||
commitish: main | ||
# disable-autolabeler: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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 @@ | ||
name: 'Releasing Image 🚀' | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
release_image: | ||
name: 'Releasing Image 🐳' | ||
strategy: | ||
matrix: | ||
config: | ||
- { dockerfile: "Dockerfile", platforms: "linux/amd64,linux/arm64" } | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Github Container Registry | ||
uses: docker/login-action@v3 | ||
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success() | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Get Tag Name | ||
id: tag | ||
shell: bash | ||
run: | | ||
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV | ||
- name: Push Docker image | ||
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success() | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: true | ||
platforms: ${{ matrix.config.platforms }} | ||
tags: "ghcr.io/${{ secrets.NAMESPACE }}/${{ secrets.IMAGE_NAME }}:${{ env.TAG }}" | ||
file: ${{ matrix.config.dockerfile }} |
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,8 @@ | ||
FROM node:20.15.1-slim | ||
WORKDIR /app | ||
COPY . . | ||
|
||
HEALTHCHECK --interval=300s --timeout=30s --start-period=5s --retries=3 CMD [ "node", "healthy-check.js" ] | ||
RUN npm install -g pnpm && pnpm install | ||
EXPOSE 8000 | ||
ENTRYPOINT [ "npm", "start" ] |
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,12 @@ | ||
PROJECT_NAME:=voyager | ||
CONTAINER_NAME:=voyager:v0.1.0 | ||
PORT:=8000 | ||
|
||
|
||
.PHONY: build | ||
build: | ||
@docker build -t $(CONTAINER_NAME) . | ||
|
||
.PHONY: run | ||
run: build | ||
@docker run --rm -p $(PORT):$(PORT) --name $(PROJECT_NAME) $(CONTAINER_NAME) |