Skip to content

Commit 3947e3c

Browse files
committed
update readme, add testing/container urls
1 parent c63b8bd commit 3947e3c

File tree

3 files changed

+86
-6
lines changed

3 files changed

+86
-6
lines changed

.github/workflows/container.yml

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

.github/workflows/rust.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Rust
2+
3+
on:
4+
push:
5+
branches: ["master"]
6+
pull_request:
7+
branches: ["master"]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Build
19+
run: cargo build --verbose
20+
- name: Run tests
21+
run: cargo test --verbose

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,23 @@ This is the backend to [cmdb](https://github.com/cmss13-devs/cmdb), to provide A
88

99
```toml
1010
[host]
11-
base_url = "/foobar" // if your api is served on a different route
11+
base_url = "/foobar" # if your api is served on a different route
1212

1313
[topic]
14-
host = "play.cm-ss13.com:1400" // which game server should be pinged for status updates
15-
auth = "your-auth-token-here" // the comms key to contact the game server
14+
host = "play.cm-ss13.com:1400" # which game server should be pinged for status updates
15+
auth = "your-auth-token-here" # the comms key to contact the game server
1616

1717
[logging]
18-
webhook = "some discord webhook" // for actions impacting the database, a discord webhook
18+
webhook = "some discord webhook" # for actions impacting the database, a discord webhook
1919
```
2020

2121
### Rocket.toml
2222

2323
```toml
2424
[default]
25-
address = "0.0.0.0"
25+
address = "0.0.0.0" # the address the web server should bind to, ie 0.0.0.0 in a container
2626
port = 8080
2727

2828
[default.databases.cmdb]
29-
url = "mysql://root:[email protected]:3306/cmdb"
29+
url = "mysql://root:[email protected]:3306/cmdb" # pg-esque formatting string
3030
```

0 commit comments

Comments
 (0)