Skip to content

Commit

Permalink
Keep the lights on, rfs #273
Browse files Browse the repository at this point in the history
  • Loading branch information
rednafi committed Oct 21, 2023
1 parent 7579cf0 commit b71bb14
Show file tree
Hide file tree
Showing 15 changed files with 247 additions and 227 deletions.
5 changes: 3 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

# Host and port.
HOST="0.0.0.0" # localhost
PORT="5000" # port to access the app
PORT="5002" # port to access the app
PYTHON_VERSION="39" # which dockerfile to use. see in dockerfiles/python*/Dockerfile

# App config.

Expand All @@ -14,4 +15,4 @@ API_PASSWORD="debian"
API_SECRET_KEY="09d25e094faa6ca2556c818166b7a9563b93f7099f6f0f4caa6cf63b88e8d3e7"
API_ALGORITHM="HS256"
# infinity
API_ACCESS_TOKEN_EXPIRE_MINUTES="5256000000"
API_ACCESS_TOKEN_EXPIRE_MINUTES="5256000000"
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ updates:
- package-ecosystem: "pip" # See documentation for possible values.
directory: "/" # Location of package manifests.
schedule:
interval: "daily"
interval: "monthly"

# Maintain dependencies for GitHub Actions.
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
interval: "monthly"
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Test Container

on: [push]

jobs:
test:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Spin up container
run: |
docker compose up
- name: Wait for container to be ready
run: |
attempts=0
while [ $attempts -lt 5 ]; do
if curl http://localhost:5002; then
echo "Success!"
exit 0
fi
attempts=$((attempts+1))
sleep 1
done
echo "Failed after $attempts attempts"
exit 1
- name: Make HTTP request
run: |
curl http://localhost:5002
15 changes: 4 additions & 11 deletions .github/workflows/ci.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@

name: Run tests & publish image to Dockerhub
name: Run tests

on:
release:
types: [published]
branches:
- master
tags:
- "v*"

push:
branches:
- master
Expand All @@ -20,8 +13,8 @@ on:
- master

schedule:
# Every day at 12:32 UTC.
- cron: "32 12 * * *"
# Every sunday at 8:05 UTC
- cron: "5 8 * * 0"

# If you trigger a new workflow while the previous one is running,
# this will cancel the previous one.
Expand All @@ -36,7 +29,7 @@ jobs:
# Use matrix strategy to run the tests on multiple Py versions on multiple OSs.
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
include:
- os: ubuntu-latest
path: ~/.cache/pip
Expand Down
2 changes: 1 addition & 1 deletion Caddyfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# https://caddyserver.com/docs/caddyfile/concepts

:{$PORT} {
reverse_proxy /* fnano:6969
reverse_proxy /* fnano:5001
encode zstd gzip
}
Loading

0 comments on commit b71bb14

Please sign in to comment.