Skip to content

Commit

Permalink
add new meta files
Browse files Browse the repository at this point in the history
  • Loading branch information
Dougley committed Aug 5, 2021
1 parent 755e558 commit acbc2a1
Show file tree
Hide file tree
Showing 7 changed files with 164 additions and 9 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/deployments.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Deploy

on:
workflow_run:
workflows: ["Docker"]
branches:
- master
types:
- completed

jobs:
determine-image:
if: github.event.workflow_run.conclusion == 'success'
name: Determine image to use
runs-on: ubuntu-latest

outputs:
tag: ${{ steps.sha_tag.outputs.tag }}
steps:
- name: Create SHA Container Tag
id: sha_tag
run: |
[[ "${{ github.ref }}" != "refs/tags/"* ]] && tag=sha-$(cut -c 1-7 <<< $GITHUB_SHA)
[[ "${{ github.ref }}" == "refs/tags/"* ]] && tag=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
echo "::set-output name=tag::$tag"
prod-deploy:
environment: production
needs: determine-image
if: ${{ !startsWith(needs.determine-image.outputs.tag, 'sha-') }}
name: Deploy to production
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- run: echo "deploying to production with tag ${{ needs.determine-image.outputs.tag }}"
- name: Authenticate with Kubernetes
uses: azure/k8s-set-context@v1
with:
method: kubeconfig
kubeconfig: ${{ secrets.KUBECONFIG }}

- name: Deploy to Kubernetes
uses: Azure/k8s-deploy@v1
with:
manifests: |
manifests/deployment.yaml
images: 'ghcr.io/thesharks/wildbeast:${{ needs.determine-image.outputs.tag }}'
kubectl-version: 'latest'
namespace: wildbeast-staging

staging-deploy:
environment: staging
needs: determine-image
if: ${{ startsWith(needs.determine-image.outputs.tag, 'sha-') }}
name: Deploy to staging
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- run: echo "deploying to staging with tag ${{ needs.determine-image.outputs.tag }}"
- name: Authenticate with Kubernetes
uses: azure/k8s-set-context@v1
with:
method: kubeconfig
kubeconfig: ${{ secrets.KUBECONFIG }}

- name: Deploy to Kubernetes
uses: Azure/k8s-deploy@v1
with:
manifests: |
bot/deployment.yaml
images: 'ghcr.io/thesharks/wildbeast:${{ needs.determine-image.outputs.tag }}'
kubectl-version: 'latest'
namespace: wildbeast-production
11 changes: 9 additions & 2 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ on:

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x, 14.x]
Expand All @@ -31,3 +29,12 @@ jobs:
- run: npm test
env:
CI: true
automerge:
needs: build
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: fastify/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
target: minor
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ WORKDIR /usr/wildbeast
COPY tsconfig.json ./
COPY package*.json ./

RUN npm install

COPY src ./src

RUN npm install
RUN npm run compile
RUN npm prune --production

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<div>
<div style="margin-left:auto;margin-right:auto;">
<img src="https://i.imgur.com/4wYz7Y2.png"><br><br>
<img src="assets/wildbeast.png"><br><br>
<p align="center" style="margin:0;">
<a href="https://github.com/TheSharks/WildBeast/releases"><img src="https://img.shields.io/github/package-json/v/thesharks/wildbeast.svg?label=version&style=for-the-badge&maxAge=300" alt="Version"></a>
<a href="https://github.com/TheSharks/Wildbeast/releases"><img src="https://img.shields.io/github/package-json/v/thesharks/wildbeast.svg?label=version&style=for-the-badge&maxAge=300" alt="Version"></a>
<a href="https://discord.gg/wildbot"><img src="https://img.shields.io/discord/110462143152803840.svg?logo=discord&style=for-the-badge&maxAge=300" alt="Discord server"></a>
<a href="https://liberapay.com/Dougley"><img src="http://img.shields.io/liberapay/patrons/Dougley.svg?logo=liberapay&style=for-the-badge&maxAge=300" alt="Liberapay"></a>
<a href="https://github.com/sponsors/Dougley"><img src="http://img.shields.io/github/sponsors/Dougley.svg?logo=githubsponsors&style=for-the-badge&maxAge=300" alt="Github Sponsors"></a>
</p>
<p align="center" style="margin:0;">
<a title="Crowdin" target="_blank" href="https://crowdin.com/project/wildbeast"><img src="https://img.shields.io/badge/Localization-Crowdin-blue?logo=crowdin&style=for-the-badge&maxAge=300"></a>
Expand All @@ -15,7 +15,7 @@

---

WildBeast is a multifunctional Discord bot, intended to provide a framework that's easy to use, extend, and modify.
Wildbeast is a multifunctional Discord bot, intended to provide a framework that's easy to use, extend, and modify.
This is also the open source framework for [WildBot#3942 on Discord](https://invite.thesharks.xyz).

## Main features
Expand All @@ -26,11 +26,11 @@ This is also the open source framework for [WildBot#3942 on Discord](https://inv

Visit our [documentation](https://wildbeast.guide/) for more information.

### Want to use WildBeast but don't want to host it yourself?
### Want to use Wildbeast but don't want to host it yourself?

No problem, we maintain a public instance called WildBot that you can invite to your server! Visit https://invite.thesharks.xyz to get started!

### Want to run WildBeast yourself?
### Want to run Wildbeast yourself?

We've got you covered on that - we provide installation instructions for Windows and Linux. Check out the [Windows installation manual](https://wildbeast.guide/install_windows) or [Linux installation manual](https://wildbeast.guide/install_linux) to get started.

Expand Down
Binary file added assets/wildbeast.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions manifests/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: wildbeast
spec:
selector:
matchLabels:
app: wildbeast
template:
metadata:
labels:
app: wildbeast
spec:
containers:
- name: wildbeast
image: ghcr.io/thesharks/wildbeast:edge
imagePullPolicy: Always
resources:
requests:
memory: "600Mi"
cpu: "750m"
limits:
memory: "800Mi"
cpu: "1000m"
envFrom:
- secretRef:
name: bot-env
- secretRef:
name: sentry-env
- secretRef:
name: db-credentials

36 changes: 36 additions & 0 deletions manifests/secrets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: v1
kind: Secret
metadata:
name: bot-env
type: Opaque
data:
BOT_TOKEN: <Replace me>
BOT_PREFIX: ++
INVIDIOUS_HOST: <Pick a server from https://invidio.us>
LAVALINK_DISCOVERY: |
'{"hostname":"lavalink.lavalink.svc.cluster.local", "port": 2333,"password":"youshallnotpass"}'
---

apiVersion: v1
kind: Secret
metadata:
name: sentry-env
type: Opaque
data:
SENTRY_DSN: https://ingest.sentry.io

---

apiVersion: v1
kind: Secret
metadata:
name: db-credentials
type: Opaque
data:
# Depending on the driver you're using, enter your credentials here
# Typically, drivers consist of a host, username, and a password
# but this can differ between drivers, check your driver's documentation
DB_HOST: <Host>
DB_USER: <User>
DB_PASSWORD: <Password>

0 comments on commit acbc2a1

Please sign in to comment.