Skip to content

Commit

Permalink
Merge pull request #1 from epeters-jrmngndr/gh-actions
Browse files Browse the repository at this point in the history
Add Github Actions
  • Loading branch information
epeters-jrmngndr authored Aug 14, 2024
2 parents 5162399 + bfa0168 commit 0bcc862
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/frontend.node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: UI Wiki Frontend
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend/
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: './frontend/package-lock.json'
- run: npm ci
- run: npm run build --if-present
- run: npm test
33 changes: 33 additions & 0 deletions .github/workflows/python-wiki-server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Python Wiki Server
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
2 changes: 2 additions & 0 deletions attach-shell.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
docker exec -it $(docker ps | sed -n '2{s/CONTAINER ID *//;s/ .*//;p}') sh
25 changes: 25 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
events {}

http {
server {
listen 8080;

proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Connection "upgrade";
proxy_set_header Upgrade $http_upgrade;
proxy_read_timeout 86400;
proxy_http_version 1.1;

# Reverse proxy for backend
location ~ ^/articles/ {
proxy_pass http://localhost:9090;
}

# Reverse proxy for frontend (and all others)
location / {
proxy_pass http://localhost:5173;
}

}
}
2 changes: 2 additions & 0 deletions run-container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
docker run -ti -p 8080:8080 md-wiki:2024

0 comments on commit 0bcc862

Please sign in to comment.