Skip to content

Commit

Permalink
Merge pull request #105 from TheLab-ms/fix/rollback-bun
Browse files Browse the repository at this point in the history
  • Loading branch information
ATechAdventurer authored Sep 11, 2023
2 parents b23a7d2 + e987c71 commit fb90acf
Show file tree
Hide file tree
Showing 14 changed files with 4,281 additions and 141 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ env:
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}


jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -37,7 +36,6 @@ jobs:
with:
cosign-release: 'v1.13.1'


# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf
Expand Down Expand Up @@ -73,7 +71,6 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max


# Sign the resulting Docker image digest except on PRs.
# This will only write to the public Rekor transparency log when the Docker
# repository is public to avoid leaking data. If you would like to publish
Expand All @@ -82,11 +79,11 @@ jobs:
- name: Sign the published Docker image
if: ${{ github.event_name != 'pull_request' }}
env:
COSIGN_EXPERIMENTAL: "true"
COSIGN_EXPERIMENTAL: 'true'
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }}

# Checkout the other repository
- name: Checkout TheLab-ms/gitops repository
uses: actions/checkout@v3
Expand Down
113 changes: 104 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,109 @@
# Other Package Mangers
package-lock.json
yarn.lock
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# General Node Stuff
node_modules
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# OS Specific
.DS_STORE
thubms.db
# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Dangerous files
# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Project specific files
config.json

.DS_STORE
17 changes: 7 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
FROM oven/bun

# We need curl for a hack
RUN apt update
RUN apt install -y curl
FROM node:lts-alpine

WORKDIR /usr

COPY package.json ./
COPY bun.lockb ./
COPY package*.json ./
COPY tsconfig.json ./
COPY src ./src

RUN bun install
RUN npm ci
RUN npm run build

RUN npm i -g pm2

CMD ["bun", "run", "start"]
CMD ["pm2-runtime", "start", "dist/index.js"]
14 changes: 3 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ Glider Bot

The official Discord Bot for TheLab.ms

Now powered by Bun
## Setup
### Prerequisites
- Bun 1.0.0 [Get it Here](https://bun.sh)
- Node.js 18.0.0 or higher

### Installation
1. Clone the repository
Expand All @@ -17,18 +16,11 @@ git clone ...
2. Install dependencies

```bash
bun install
npm install
```

3. Run the config command

```bash
bun run config
```

4. Edit the config.json file and .env
5. Run the config command again
6. Run it
```bash
bun run start
npm run config
```
Binary file removed bun.lockb
Binary file not shown.
Loading

0 comments on commit fb90acf

Please sign in to comment.