Skip to content

Commit c8f7d9b

Browse files
authored
Rewrite index to be a fully static website (#47)
This update removes backend entirely, and makes site serviceable as a plain static content. Enables simplified deployment and offline capabilities through service worker. The data amount is sufficiently small, this shouldn't cause substantial performance issues Updated wording to accentuate the main purpose of the project to be sexpr data files. The site part is a derivative / complementary feature, not the main point
1 parent 487e8ea commit c8f7d9b

File tree

154 files changed

+22682
-35018
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+22682
-35018
lines changed

.circleci/config.yml

+4-69
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,13 @@
11
version: 2.1
22

33
jobs:
4-
unit-test:
4+
test:
55
docker:
6-
- image: sbtscala/scala-sbt:eclipse-temurin-jammy-17.0.5_8_1.8.2_3.2.2
6+
- image: cimg/base:2023.03
77
steps:
8-
- checkout
9-
- run:
10-
name: Test
11-
command: |
12-
sbt test
13-
14-
build-images:
15-
machine: true
16-
steps:
17-
- checkout
18-
- run: |
19-
docker build -t arvyy/scheme-index:$CIRCLE_BRANCH -f docker/scheme-index/Dockerfile .
20-
docker build -t arvyy/scheme-index-nginx:$CIRCLE_BRANCH -f docker/nginx/Dockerfile .
21-
mkdir -p /tmp/workspace/images
22-
docker save -o /tmp/workspace/images/scheme-index:$CIRCLE_BRANCH arvyy/scheme-index:$CIRCLE_BRANCH
23-
docker save -o /tmp/workspace/images/scheme-index-nginx:$CIRCLE_BRANCH arvyy/scheme-index-nginx:$CIRCLE_BRANCH
24-
- persist_to_workspace:
25-
root: /tmp/workspace
26-
paths:
27-
- images
28-
29-
integration-test:
30-
machine: true
31-
steps:
32-
- attach_workspace:
33-
at: /tmp/workspace
34-
- checkout
35-
- run: |
36-
docker load -i /tmp/workspace/images/scheme-index:$CIRCLE_BRANCH
37-
docker load -i /tmp/workspace/images/scheme-index-nginx:$CIRCLE_BRANCH
38-
cd integrationtest/restassert
39-
BRANCH=$CIRCLE_BRANCH docker compose up --abort-on-container-exit
40-
41-
upload-images:
42-
machine: true
43-
steps:
44-
- attach_workspace:
45-
at: /tmp/workspace
46-
- run: |
47-
docker load -i /tmp/workspace/images/scheme-index:$CIRCLE_BRANCH
48-
docker load -i /tmp/workspace/images/scheme-index-nginx:$CIRCLE_BRANCH
49-
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
50-
docker push arvyy/scheme-index:$CIRCLE_BRANCH
51-
docker push arvyy/scheme-index-nginx:$CIRCLE_BRANCH
52-
53-
deploy:
54-
machine: true
55-
steps:
56-
- run:
57-
name: Deploy Over SSH
58-
command: |
59-
ssh $SSH_USER@$SSH_HOST "bash ~/update.sh"
8+
- run: echo ""
609

6110
workflows:
6211
main:
6312
jobs:
64-
- unit-test
65-
- build-images
66-
- integration-test:
67-
requires:
68-
- build-images
69-
- upload-images:
70-
requires:
71-
- integration-test
72-
- deploy:
73-
requires:
74-
- upload-images
75-
filters:
76-
branches:
77-
only:
78-
- master
13+
- test

.github/workflows/master.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: 'Build and deploy on push to master'
2+
on:
3+
push:
4+
branches:
5+
- 'master'
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: docker/build-push-action@v6
13+
with:
14+
push: false
15+
tags: 'scheme-index:latest'
16+
file: ./build/Dockerfile
17+
- run: |
18+
docker create --name dummy scheme-index:latest
19+
docker cp dummy:/schemeindex.zip /tmp/schemeindex.zip
20+
docker rm -f dummy
21+
- uses: actions/upload-artifact@v4
22+
with:
23+
name: schemeindex
24+
path: /tmp/schemeindex.zip
25+
26+
deploy_ansible:
27+
needs:
28+
- build
29+
runs-on: ubuntu-latest
30+
environment: Prod
31+
steps:
32+
- uses: actions/checkout@v4
33+
- uses: webfactory/[email protected]
34+
with:
35+
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
36+
- uses: actions/download-artifact@v4
37+
with:
38+
name: schemeindex
39+
path: build
40+
- run: |
41+
sudo apt-get install ansible
42+
ssh-keyscan -t rsa index.scheme.org >> ~/.ssh/known_hosts
43+
cd deploy
44+
ansible-playbook -i hosts deploy.yml -e content_zip_file=$GITHUB_WORKSPACE/build/schemeindex.zip

.github/workflows/pullrequest.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: 'Lint & test build on pull request'
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- uses: actions/setup-node@v4
11+
with:
12+
node-version: '20.x'
13+
- run: |
14+
cd scheme-index-app
15+
npm install
16+
npm run lint
17+
build:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: docker/build-push-action@v6
22+
with:
23+
push: false
24+
tags: 'scheme-index:latest'
25+
file: ./build/Dockerfile

.gitmodules

Whitespace-only changes.

LICENSE

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
Below license is only for software code, ie., files under tool, scheme-index-app and scheme-index-util folders.
2+
13
MIT License
24

35
Copyright (c) 2022 Arvydas Silanskas

0 commit comments

Comments
 (0)