Skip to content

Commit 4e2e0f7

Browse files
authored
implements a discord bot for searching and reviewing ref pages (#121)
1) did i include_str!() every file in the content/ directory? yes 2) why? because i really did not want to deal with i/o or even worse libshit2 i figured i'd just put it up in a container with watchtower and update the image on push to the repo and yes this is one of my first rust projects how could you tell
1 parent 66c8c13 commit 4e2e0f7

File tree

11 files changed

+2892
-1
lines changed

11 files changed

+2892
-1
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and Deploy
1+
name: Build and Deploy Site
22

33
permissions:
44
contents: write
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Build and Deploy Bot Container
2+
3+
permissions:
4+
contents: write
5+
pages: write
6+
id-token: write
7+
8+
on:
9+
push:
10+
branches: ["main"]
11+
workflow_dispatch:
12+
13+
env:
14+
REGISTRY: ghcr.io
15+
IMAGE_NAME: ${{ github.repository }}
16+
17+
jobs:
18+
build:
19+
name: Build
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
packages: write
24+
id-token: write
25+
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
30+
# Set up BuildKit Docker container builder to be able to build
31+
# multi-platform images and export cache
32+
# https://github.com/docker/setup-buildx-action
33+
- name: Set up Docker Buildx
34+
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
35+
36+
# Login against a Docker registry
37+
# https://github.com/docker/login-action
38+
- name: Log into registry ${{ env.REGISTRY }}
39+
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
40+
with:
41+
registry: ${{ env.REGISTRY }}
42+
username: ${{ github.actor }}
43+
password: ${{ secrets.GITHUB_TOKEN }}
44+
45+
# Extract metadata (tags, labels) for Docker
46+
# https://github.com/docker/metadata-action
47+
- name: Extract Docker metadata
48+
id: meta
49+
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
50+
with:
51+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
52+
53+
# Build and push Docker image with Buildx
54+
# https://github.com/docker/build-push-action
55+
- name: Build and push Docker image
56+
id: build-and-push
57+
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
58+
with:
59+
context: .
60+
push: ${{ github.event_name != 'pull_request' }}
61+
tags: ${{ steps.meta.outputs.tags }}
62+
labels: ${{ steps.meta.outputs.labels }}
63+
cache-from: type=gha
64+
cache-to: type=gha,mode=max

tools/od_ref_bot/.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src/content.rs

tools/od_ref_bot/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
target/
2+
.env
3+
4+
# build artifact
5+
src/content.rs

0 commit comments

Comments
 (0)