Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Include any files or directories that you don't want to be copied to your

# container here (e.g., local build artifacts, temporary files, etc.).

#

# For more help, visit the .dockerignore file reference guide at

# https://docs.docker.com/go/build-context-dockerignore/

**/.classpath
Expand All @@ -17,12 +21,12 @@
**/.next
**/.cache
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/_.dbmdl
\*\*/_.jfm
**/charts
**/docker-compose*
**/compose.y*ml
**/Dockerfile*
\*\*/compose.y*ml
**/Dockerfile\*
**/node_modules
**/npm-debug.log
**/obj
Expand Down
27 changes: 3 additions & 24 deletions .github/workflows/automaticTesting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ on:
# - mizuho-githubaction # Run on pull request targeting `mizuho-githubaction` branch

jobs:
<<<<<<< HEAD
jest_test:
=======
unit_tests:
>>>>>>> origin/mizuho-integration
if: github.event_name == 'push' || github.event_name == 'pull_request'
runs-on: ubuntu-latest

Expand All @@ -29,13 +25,8 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
<<<<<<< HEAD
node-version: ">=18"
node-version: "20"
cache: "npm"
=======
node-version: '20'
cache: 'npm'
>>>>>>> origin/mizuho-integration

- name: Install required system dependencies
run: |
Expand All @@ -46,8 +37,6 @@ jobs:
run: |
npm cache clean --force
npm ci
<<<<<<< HEAD
=======

- name: Set config file
run: cp config.example.ts config.ts
Expand Down Expand Up @@ -87,8 +76,8 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
node-version: "20"
cache: "npm"

- name: Install required system dependencies
run: |
Expand All @@ -107,13 +96,3 @@ jobs:
run: npx jest -c jest.config.js --no-cache --testMatch="**/*integration*.test.ts"
env:
MONGODB_URI: mongodb://test:test@localhost:27017/sage_test?authSource=admin
>>>>>>> origin/mizuho-integration

- name: Set config file
run: cp config.example.ts config.ts

- name: Show Jest config
run: npx jest --showConfig | sed -n '1,120p'

- name: Run Jest tests (no cache)
run: npx jest -c jest.config.js --no-cache
50 changes: 1 addition & 49 deletions .github/workflows/dockerimage.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
name: dockerimage #name of the workflow

on:
<<<<<<< HEAD
workflow_call:
secrets:
=======
workflow_call:
secrets:
>>>>>>> origin/mizuho-integration
DOCKER_USER:
required: true
DOCKER_PASSWORD:
Expand All @@ -17,7 +12,6 @@ on:

jobs:
build-and-push:
<<<<<<< HEAD
# Build & push Docker image only on push events (not PRs) and after tests
if: github.event_name == 'push'
runs-on: ubuntu-latest
Expand Down Expand Up @@ -48,6 +42,7 @@ jobs:
tags: |
type=raw,value=test-bot,enable=${{ github.ref == 'refs/heads/mizuho-githubaction' }}
type=sha,enable=true,format=long

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
Expand All @@ -58,46 +53,3 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=docker.io/kevlund/sage-repo:buildcache
cache-to: type=registry,ref=docker.io/kevlund/sage-repo:buildcache,mode=max
=======
# Build & push Docker image only on push events (not PRs) and after tests
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Checkout
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: Log in to Docker Hub
uses: docker/login-action@v3
with:
registry: docker.io
# Ensure these secrets are defined in repository settings
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
docker.io/kevlund/sage-repo
tags: |
type=raw,value=test-bot,enable=${{ github.ref == 'refs/heads/mizuho-githubaction' }}
type=sha,enable=true,format=long

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=docker.io/kevlund/sage-repo:buildcache
cache-to: type=registry,ref=docker.io/kevlund/sage-repo:buildcache,mode=max
>>>>>>> origin/mizuho-integration
14 changes: 2 additions & 12 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
name: documentation

on:
<<<<<<< HEAD
workflow_call:
=======
workflow_call:
>>>>>>> origin/mizuho-integration
# push:
# branches: [ "main", "Ava-branch-config", "mizuho-githubaction" ]

Expand All @@ -14,11 +10,6 @@ jobs:
runs-on: ubuntu-latest

steps:
<<<<<<< HEAD
- name: autodoc
run: echo "Not completed yet"
# run: npm run autodoc
=======
- name: Checkout repository
uses: actions/checkout@v4
with:
Expand All @@ -27,8 +18,8 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
node-version: "20"
cache: "npm"

- name: Install dependencies
run: npm ci
Expand All @@ -52,4 +43,3 @@ jobs:
Commands.md
Staff Commands.md
retention-days: 30
>>>>>>> origin/mizuho-integration
22 changes: 2 additions & 20 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@ name: Main Pipeline

on:
push:
<<<<<<< HEAD
branches: ["main"]
branches: ["mizuho-githubaction", "Ava-branch-config", "main"]
pull_request:
branches: ["main"]
=======
branches: [ "mizuho-integration" ]
pull_request:
branches: [ "mizuho-integration" ]
>>>>>>> origin/mizuho-integration
branches: ["mizuho-githubaction", "Ava-branch-config", "main"]

env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
Expand All @@ -22,14 +16,6 @@ permissions:
security-events: write
actions: read

<<<<<<< HEAD
=======
permissions:
contents: read
security-events: write
actions: read

>>>>>>> origin/mizuho-integration
jobs:
node:
uses: ./.github/workflows/node.js.yml
Expand All @@ -41,8 +27,4 @@ jobs:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
automaticTesting:
<<<<<<< HEAD
uses: ./.github/workflows/automaticTesting.yml
=======
uses: ./.github/workflows/automaticTesting.yml
>>>>>>> origin/mizuho-integration
38 changes: 7 additions & 31 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,16 @@ jobs:
runs-on: ubuntu-latest

steps:
<<<<<<< HEAD
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.sha }}

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ">=18"
node-version: "20"
cache: "npm"
=======
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.sha }}
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
>>>>>>> origin/mizuho-integration

- name: Install required system dependencies
run: |
Expand All @@ -41,23 +30,19 @@ jobs:
- run: npm cache clean --force
- run: npm ci

# Add this step to copy config.example.ts to config.ts
- name: Set config file
run: cp config.example.ts config.ts

- name: build
run: |
npm run build 2>&1 | tee build-output.log
npm run build 2>&1 | tee build-output.log || true

if grep -q "node_modules/discord.js/typings/index.d.ts" build-output.log; then
echo "Ignoring build errors from node_modules/discord.js/typings/index.d.ts"

<<<<<<< HEAD
sed -i '/node_modules\/discord\.js\/typings\/index\.d\.ts/d' build-output.log
fi

if grep -q "Error" build-output.log; then
echo "Other build errors found. Failing the workflow."
if grep -i "error" build-output.log | grep -v "node_modules/discord.js/typings/index.d.ts"; then
echo "Build failed with unignored errors"
exit 1
fi

Expand All @@ -68,15 +53,6 @@ jobs:

- name: Run tests (no cache)
run: npx jest -c jest.config.js --no-cache
=======
echo "No unignored build errors found. Workflow continues."

- name: Show Jest config
run: npx jest --showConfig | sed -n '1,120p'

- name: Run tests (no cache)
run: npx jest -c jest.config.js --no-cache
>>>>>>> origin/mizuho-integration

# - name: Start Development
# run: npm run dev
# - name: Start Development
# run: npm run dev
17 changes: 10 additions & 7 deletions README.Docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@ Your application will be available at http://localhost:8080.

### Deploying your application to the cloud

First, build your image, e.g.: `docker build -t myapp .`.
If your cloud uses a different CPU architecture than your development
machine (e.g., you are on a Mac M1 and your cloud provider is amd64),
you'll want to build the image for that platform, e.g.:
`docker build --platform=linux/amd64 -t myapp .`.
First, build your image: `docker build -t myapp .`

Then, push it to your registry, e.g. `docker push myregistry.com/myapp`.
If your cloud uses a different CPU architecture than your development machine
(e.g., you are on a Mac M1 and your cloud provider is amd64),\
you'll want to build the image for that platform:
`docker build --platform=linux/amd64 -t myapp .`

Then, push it to your registry:
`docker push myregistry.com/myapp`

Consult Docker's [getting started](https://docs.docker.com/go/get-started-sharing/)
docs for more detail on building and pushing.

### References
* [Docker's Node.js guide](https://docs.docker.com/language/nodejs/)

- [Docker's Node.js guide](https://docs.docker.com/language/nodejs/)
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# Sage

![GitHub package.json version](https://img.shields.io/github/package-json/v/ud-cis-discord/sagev2?color=000855) ![We use Typescript](https://img.shields.io/badge/written_in-typescript-000855?logo=typescript&logoColor=ddd) ![GitHub Workflow Status](https://img.shields.io/github/workflow/status/ud-cis-discord/sagev2/Lint?color=000855&logo=github) ![GitHub repo size](https://img.shields.io/github/repo-size/ud-cis-discord/sagev2?color=000855&logo=github) ![Lines of code](https://img.shields.io/tokei/lines/github/ud-cis-discord/sagev2?color=000855&logo=github)

Sage is a purpose build Discord bot to manage the UD CIS Discord server. Sage features a number of systems to encourage engagement and help facilitate learning.
<br>
Some features of sage include:

- 🧙‍♂️ Self-assignable roles
- 🎫 Question tagging so you can easily find questions others have asked
- 🐱‍👤 Private and anonymous questions
- 🔥 and many more!

Sage was originally created by:
Sage was originally created by:
| <div style="float: left; text-align: center; padding: 10px"><img src="https://avatars.githubusercontent.com/u/34194692?v=4" height="30px" style="border-radius: 15px"><br><a href="https://github.com/BenSegal855">Ben Segal</a> </div> | <div style="float: left; text-align: center; padding: 10px;"><img src="https://avatars.githubusercontent.com/u/54593801?v=4" height="30px" style="border-radius: 15px"><br><a href="https://github.com/joshualyon7">Josh Lyon</a> </div> |<div style="float: left; text-align: center; padding: 10px;"><img src="https://avatars.githubusercontent.com/u/60983762?s=460&u=46281912deec981f7c2160fe20ac9516bc59f3ff&v=4" height="30px" style="border-radius: 15px"><br><a href="https://github.com/renross">Ren Ross</a> </div>
|-|-|-

Sage is currently maintained by:
| <div style="float: left; text-align: center; padding: 10px"><img src="https://avatars.githubusercontent.com/u/58154576?v=4" height="30px" style="border-radius: 15px"><br><a href="https://github.com/sbrugel">Simon Brugel</a> </div> | <div style="float: left; text-align: center; padding: 10px;"><img src="https://avatars.githubusercontent.com/u/134813338?v=4" height="30px" style="border-radius: 15px"><br><a href="https://github.com/mattnadar">Matt Nadar</a> </div> | <div style="float: left; text-align: center; padding: 10px;"><img src="https://avatars.githubusercontent.com/u/115847166?v=4" height="30px" style="border-radius: 15px"><br><a href="https://github.com/leo-cx">Leo Chen</a> </div>
| <div style="float: left; text-align: center; padding: 10px"><img src="https://avatars.githubusercontent.com/u/58154576?v=4" height="30px" style="border-radius: 15px"><br><a href="https://github.com/sbrugel">Simon Brugel</a> </div> | <div style="float: left; text-align: center; padding: 10px;"><img src="https://avatars.githubusercontent.com/u/134813338?v=4" height="30px" style="border-radius: 15px"><br><a href="https://github.com/mattnadar">Matt Nadar</a> </div> | <div style="float: left; text-align: center; padding: 10px;"><img src="https://avatars.githubusercontent.com/u/115847166?v=4" height="30px" style="border-radius: 15px"><br><a href="https://github.com/leo-cx">Leo Chen</a> </div>
|-|-|-
Loading
Loading