Skip to content

Commit 0bcc862

Browse files
Merge pull request #1 from epeters-jrmngndr/gh-actions
Add Github Actions
2 parents 5162399 + bfa0168 commit 0bcc862

File tree

5 files changed

+89
-0
lines changed

5 files changed

+89
-0
lines changed
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: UI Wiki Frontend
2+
on:
3+
push:
4+
branches: [ "main" ]
5+
pull_request:
6+
branches: [ "main" ]
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
defaults:
12+
run:
13+
working-directory: ./frontend/
14+
strategy:
15+
matrix:
16+
node-version: [20.x]
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
cache: 'npm'
24+
cache-dependency-path: './frontend/package-lock.json'
25+
- run: npm ci
26+
- run: npm run build --if-present
27+
- run: npm test
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Python Wiki Server
2+
on:
3+
push:
4+
branches: [ "main" ]
5+
pull_request:
6+
branches: [ "main" ]
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up Python 3.10
17+
uses: actions/setup-python@v3
18+
with:
19+
python-version: "3.10"
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install flake8 pytest
24+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
25+
- name: Lint with flake8
26+
run: |
27+
# stop the build if there are Python syntax errors or undefined names
28+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
29+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
30+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
31+
- name: Test with pytest
32+
run: |
33+
pytest

attach-shell.sh

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
docker exec -it $(docker ps | sed -n '2{s/CONTAINER ID *//;s/ .*//;p}') sh

nginx.conf

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
events {}
2+
3+
http {
4+
server {
5+
listen 8080;
6+
7+
proxy_set_header Host $host;
8+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
9+
proxy_set_header Connection "upgrade";
10+
proxy_set_header Upgrade $http_upgrade;
11+
proxy_read_timeout 86400;
12+
proxy_http_version 1.1;
13+
14+
# Reverse proxy for backend
15+
location ~ ^/articles/ {
16+
proxy_pass http://localhost:9090;
17+
}
18+
19+
# Reverse proxy for frontend (and all others)
20+
location / {
21+
proxy_pass http://localhost:5173;
22+
}
23+
24+
}
25+
}

run-container.sh

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
docker run -ti -p 8080:8080 md-wiki:2024

0 commit comments

Comments
 (0)