Skip to content

Commit cfaab30

Browse files
authored
Merge pull request pathintegral-institute#2 from melio/adapt-ci
Adapt ci
2 parents a1026fa + 630c7de commit cfaab30

File tree

6 files changed

+353
-245
lines changed

6 files changed

+353
-245
lines changed

.circleci/config.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
version: 2.1
2+
3+
orbs:
4+
node: circleci/[email protected]
5+
python: circleci/[email protected]
6+
aws-cli: circleci/[email protected]
7+
8+
jobs:
9+
test:
10+
docker:
11+
- image: cimg/python:3.10
12+
steps:
13+
- checkout
14+
- run:
15+
name: Install uv
16+
command: |
17+
curl -LsSf https://astral.sh/uv/install.sh | sh
18+
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> $BASH_ENV
19+
- run:
20+
name: Install dependencies
21+
command: |
22+
uv sync --group dev
23+
- run:
24+
name: Validate Server JSON Files
25+
command: |
26+
# Validate all server JSON files against schema using uv environment
27+
source .venv/bin/activate
28+
for file in mcp-registry/servers/*.json; do
29+
echo "Validating $file"
30+
python -c "
31+
import json
32+
import jsonschema
33+
34+
with open('mcp-registry/schema/server-schema.json') as schema_file:
35+
schema = json.load(schema_file)
36+
37+
with open('$file') as data_file:
38+
data = json.load(data_file)
39+
40+
jsonschema.validate(data, schema)
41+
print('✓ Valid')
42+
"
43+
done
44+
- run:
45+
name: Run tests
46+
command: |
47+
source .venv/bin/activate
48+
pytest
49+
- run:
50+
name: Check code style with ruff
51+
command: |
52+
source .venv/bin/activate
53+
ruff check src/ tests/
54+
55+
deploy:
56+
docker:
57+
- image: cimg/python:3.10
58+
steps:
59+
- checkout
60+
- run:
61+
name: Install uv
62+
command: |
63+
curl -LsSf https://astral.sh/uv/install.sh | sh
64+
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> $BASH_ENV
65+
- run:
66+
name: Install Python dependencies
67+
command: |
68+
uv sync --group dev
69+
- run:
70+
name: Run preparation script
71+
command: |
72+
chmod +x ./scripts/prepare.sh
73+
source .venv/bin/activate
74+
./scripts/prepare.sh ./output
75+
- aws-cli/setup
76+
- run:
77+
name: Upload servers.json to S3
78+
command: |
79+
aws s3 cp ./output/api/servers.json s3://aitools.eilat.melioservices.com/mcpm/servers.json --content-type "application/json"
80+
- run:
81+
name: Upload install script to S3
82+
command: |
83+
aws s3 cp ./pages/install s3://aitools.eilat.melioservices.com/mcpm/install --content-type "text/plain"
84+
- run:
85+
name: Invalidate CloudFront cache
86+
command: |
87+
aws cloudfront create-invalidation --distribution-id E3VSH7IG39WRB6 --paths "/mcpm/servers.json" "/mcpm/install"
88+
89+
workflows:
90+
test-and-deploy:
91+
jobs:
92+
- test
93+
- deploy:
94+
context: melio-eilat
95+
requires:
96+
- test
97+
filters:
98+
branches:
99+
only: melio

.github/workflows/deploy.yml

Lines changed: 103 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,103 @@
1-
name: Deploy to GitHub Pages
2-
3-
on:
4-
push:
5-
branches:
6-
- main
7-
workflow_dispatch:
8-
schedule:
9-
- cron: '0 */6 * * *' # Run every 6 hours
10-
11-
permissions:
12-
contents: read
13-
pages: write
14-
id-token: write
15-
16-
concurrency:
17-
group: "pages"
18-
cancel-in-progress: false
19-
20-
jobs:
21-
validate:
22-
uses: ./.github/workflows/test.yml
23-
24-
build:
25-
runs-on: ubuntu-latest
26-
needs: validate
27-
steps:
28-
- name: Checkout
29-
uses: actions/checkout@v4
30-
31-
- name: Setup Pages
32-
uses: actions/configure-pages@v5
33-
34-
- name: Install uv with caching
35-
uses: astral-sh/setup-uv@v5
36-
with:
37-
enable-cache: true
38-
cache-dependency-glob: "pyproject.toml"
39-
40-
- name: Install dependencies
41-
run: |
42-
uv sync --group dev
43-
44-
- name: Setup site structure
45-
run: |
46-
mkdir -p pages/registry
47-
mkdir -p pages/api/servers
48-
49-
- name: Run preparation script
50-
env:
51-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52-
run: |
53-
chmod +x ./scripts/prepare.sh
54-
source .venv/bin/activate
55-
./scripts/prepare.sh ./pages
56-
57-
58-
- name: Build with Jekyll
59-
uses: actions/jekyll-build-pages@v1
60-
with:
61-
source: ./pages
62-
destination: ./_site
63-
64-
- name: Upload artifact
65-
uses: actions/upload-pages-artifact@v3
66-
67-
deploy:
68-
environment:
69-
name: github-pages
70-
url: ${{ steps.deployment.outputs.page_url }}
71-
runs-on: ubuntu-latest
72-
needs: build
73-
steps:
74-
- name: Deploy to GitHub Pages
75-
id: deployment
76-
uses: actions/deploy-pages@v4
77-
78-
deploy-cloudflare:
79-
runs-on: ubuntu-latest
80-
needs: build
81-
steps:
82-
- name: Checkout
83-
uses: actions/checkout@v4
84-
85-
- name: Download artifact
86-
uses: actions/download-artifact@v4
87-
with:
88-
name: github-pages
89-
path: ./dist
90-
91-
- name: Extract artifact
92-
run: |
93-
tar -xf ./dist/artifact.tar -C ./dist
94-
rm ./dist/artifact.tar
95-
96-
- name: Deploy to Cloudflare Pages
97-
uses: cloudflare/pages-action@v1
98-
with:
99-
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
100-
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
101-
projectName: mcpm-sh
102-
directory: ./dist
1+
# DISABLED: Deploy to GitHub Pages
2+
#name: Deploy to GitHub Pages
3+
#
4+
#on:
5+
# push:
6+
# branches:
7+
# - main
8+
# workflow_dispatch:
9+
# schedule:
10+
# - cron: '0 */6 * * *' # Run every 6 hours
11+
#
12+
#permissions:
13+
# contents: read
14+
# pages: write
15+
# id-token: write
16+
#
17+
#concurrency:
18+
# group: "pages"
19+
# cancel-in-progress: false
20+
#
21+
#jobs:
22+
# validate:
23+
# uses: ./.github/workflows/test.yml
24+
#
25+
# build:
26+
# runs-on: ubuntu-latest
27+
# needs: validate
28+
# steps:
29+
# - name: Checkout
30+
# uses: actions/checkout@v4
31+
#
32+
# - name: Setup Pages
33+
# uses: actions/configure-pages@v5
34+
#
35+
# - name: Install uv with caching
36+
# uses: astral-sh/setup-uv@v5
37+
# with:
38+
# enable-cache: true
39+
# cache-dependency-glob: "pyproject.toml"
40+
#
41+
# - name: Install dependencies
42+
# run: |
43+
# uv sync --group dev
44+
#
45+
# - name: Setup site structure
46+
# run: |
47+
# mkdir -p pages/registry
48+
# mkdir -p pages/api/servers
49+
#
50+
# - name: Run preparation script
51+
# env:
52+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
# run: |
54+
# chmod +x ./scripts/prepare.sh
55+
# source .venv/bin/activate
56+
# ./scripts/prepare.sh ./pages
57+
#
58+
#
59+
# - name: Build with Jekyll
60+
# uses: actions/jekyll-build-pages@v1
61+
# with:
62+
# source: ./pages
63+
# destination: ./_site
64+
#
65+
# - name: Upload artifact
66+
# uses: actions/upload-pages-artifact@v3
67+
#
68+
# deploy:
69+
# environment:
70+
# name: github-pages
71+
# url: ${{ steps.deployment.outputs.page_url }}
72+
# runs-on: ubuntu-latest
73+
# needs: build
74+
# steps:
75+
# - name: Deploy to GitHub Pages
76+
# id: deployment
77+
# uses: actions/deploy-pages@v4
78+
#
79+
# deploy-cloudflare:
80+
# runs-on: ubuntu-latest
81+
# needs: build
82+
# steps:
83+
# - name: Checkout
84+
# uses: actions/checkout@v4
85+
#
86+
# - name: Download artifact
87+
# uses: actions/download-artifact@v4
88+
# with:
89+
# name: github-pages
90+
# path: ./dist
91+
#
92+
# - name: Extract artifact
93+
# run: |
94+
# tar -xf ./dist/artifact.tar -C ./dist
95+
# rm ./dist/artifact.tar
96+
#
97+
# - name: Deploy to Cloudflare Pages
98+
# uses: cloudflare/pages-action@v1
99+
# with:
100+
# apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
101+
# accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
102+
# projectName: mcpm-sh
103+
# directory: ./dist

.github/workflows/frp.yml

Lines changed: 42 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,43 @@
1-
name: Build and Push frp Docker Image
1+
# DISABLED: Build and Push frp Docker Image workflow
2+
# Uncomment to re-enable
23

3-
on:
4-
push:
5-
branches: [ main ]
6-
paths:
7-
- 'dockerfiles/frps/*'
8-
- 'dockerfiles/frpc/*'
9-
10-
jobs:
11-
build-and-push:
12-
runs-on: ubuntu-latest
13-
permissions:
14-
contents: read
15-
packages: write
16-
17-
steps:
18-
- name: Checkout code
19-
uses: actions/checkout@v4
20-
21-
- name: Log in to GitHub Container Registry
22-
uses: docker/login-action@v3
23-
with:
24-
registry: ghcr.io
25-
username: ${{ github.actor }}
26-
password: ${{ secrets.GITHUB_TOKEN }}
27-
28-
- name: Build and push frps Docker image
29-
uses: docker/build-push-action@v6
30-
with:
31-
context: ./dockerfiles/frps
32-
push: true
33-
tags: ghcr.io/${{ github.repository_owner }}/frps:latest
34-
35-
- name: Build and push frpc Docker image
36-
uses: docker/build-push-action@v6
37-
with:
38-
context: ./dockerfiles/frpc
39-
push: true
40-
tags: ghcr.io/${{ github.repository_owner }}/frpc:latest
4+
# name: Build and Push frp Docker Image
5+
#
6+
# on:
7+
# push:
8+
# branches: [ main ]
9+
# paths:
10+
# - 'dockerfiles/frps/*'
11+
# - 'dockerfiles/frpc/*'
12+
#
13+
# jobs:
14+
# build-and-push:
15+
# runs-on: ubuntu-latest
16+
# permissions:
17+
# contents: read
18+
# packages: write
19+
#
20+
# steps:
21+
# - name: Checkout code
22+
# uses: actions/checkout@v4
23+
#
24+
# - name: Log in to GitHub Container Registry
25+
# uses: docker/login-action@v3
26+
# with:
27+
# registry: ghcr.io
28+
# username: ${{ github.actor }}
29+
# password: ${{ secrets.GITHUB_TOKEN }}
30+
#
31+
# - name: Build and push frps Docker image
32+
# uses: docker/build-push-action@v6
33+
# with:
34+
# context: ./dockerfiles/frps
35+
# push: true
36+
# tags: ghcr.io/${{ github.repository_owner }}/frps:latest
37+
#
38+
# - name: Build and push frpc Docker image
39+
# uses: docker/build-push-action@v6
40+
# with:
41+
# context: ./dockerfiles/frpc
42+
# push: true
43+
# tags: ghcr.io/${{ github.repository_owner }}/frpc:latest

0 commit comments

Comments
 (0)