Skip to content

Commit cc7b610

Browse files
Restructured based on MobilityData norms...
... also fixed errors during site building.
1 parent 3de50b6 commit cc7b610

Some content is hidden

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

70 files changed

+346
-276
lines changed

.devcontainer/Dockerfile

Lines changed: 0 additions & 13 deletions
This file was deleted.

.devcontainer/README.md

Lines changed: 0 additions & 45 deletions
This file was deleted.

.devcontainer/devcontainer.json

Lines changed: 0 additions & 35 deletions
This file was deleted.

.dockerignore

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Check Website returns 200 OK
2+
3+
on:
4+
workflow_dispatch:
5+
workflow_run:
6+
workflows:
7+
- Update website on server
8+
types:
9+
- completed
10+
11+
jobs:
12+
validate:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Wait for 5 minutes
16+
run: sleep 300
17+
18+
- name: Check HTTP Status Code
19+
run: |
20+
STATUS_CODE=$(curl -s -o /dev/null -w "%{http_code}" https://interoperablemobility.org/ )
21+
if [ "$STATUS_CODE" -ne 200 ]; then
22+
echo "Error: Website returned status code $STATUS_CODE"
23+
exit 1
24+
fi
25+
echo "Website is up and returned 200"

.github/workflows/mkdocs-pr-preview.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

.github/workflows/mkdocs.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Update requirements.txt
2+
3+
on:
4+
schedule:
5+
- cron: '0 3 1 * *' # Runs every first day of the month @ 3 AM.
6+
workflow_dispatch: # Allow manual runs
7+
8+
jobs:
9+
update-requirements:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: 3.11 # Adjust to your required Python version
20+
21+
- name: Load secrets from 1Password
22+
id: onepw_secrets
23+
uses: 1password/[email protected]
24+
with:
25+
export-env: true # Export loaded secrets as environment variables
26+
env:
27+
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
28+
GITHUB_TOKEN: "op://rbiv7rvkkrsdlpcrz3bmv7nmcu/GitHub generic action token for all repos/credential"
29+
30+
- name: Create virtual environment
31+
run: |
32+
python -m venv venv
33+
source venv/bin/activate
34+
python -m pip install --upgrade pip
35+
36+
- name: Install pur
37+
run: |
38+
source venv/bin/activate
39+
pip install pur
40+
41+
- name: Update requirements.txt
42+
run: |
43+
source venv/bin/activate
44+
pur -r requirements.txt
45+
46+
- name: Check for changes
47+
id: check_changes
48+
run: |
49+
if git diff --exit-code; then
50+
echo "changes=false" >> $GITHUB_ENV
51+
else
52+
echo "changes=true" >> $GITHUB_ENV
53+
fi
54+
55+
- name: Create Branch Name
56+
id: createbranchname
57+
if: env.changes == 'true'
58+
env:
59+
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
60+
run: |
61+
branch_name="update-requirements-$(date +'%Y%m%d')"
62+
echo "branchname=branch_name" >> $GITHUB_ENV
63+
64+
- name: Create Pull Request
65+
id: createpr
66+
if: env.changes == 'true'
67+
uses: peter-evans/[email protected]
68+
with:
69+
token: ${{ env.GITHUB_TOKEN }}
70+
sign-commits: true
71+
assignees: "fredericsimard"
72+
branch: ${{ env.branchname }}
73+
commit-message: 'This PR updates the `requirements.txt` file with the latest versions of dependencies.'
74+
title: 'Monthly `requirements.txt` update'
75+
body: |
76+
This PR updates the `requirements.txt` file with the latest versions of dependencies.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Update website on server
2+
3+
# Controls when the action will run. Workflow runs when manually triggered using the UI or API.
4+
on:
5+
workflow_dispatch:
6+
push:
7+
branches:
8+
- main
9+
paths-ignore:
10+
- '.gitignore'
11+
- '.gitattributes'
12+
- 'LICENSE'
13+
- 'README.md'
14+
- '.github/workflows/**'
15+
16+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
17+
jobs:
18+
build:
19+
name: Build
20+
runs-on: ubuntu-latest
21+
steps:
22+
23+
- name: Load secrets from 1Password
24+
id: onepw_secrets
25+
uses: 1password/[email protected]
26+
with:
27+
export-env: true # Export loaded secrets as environment variables
28+
env:
29+
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
30+
ACTION_GXFS_WEBSERVER_SSH_HOST: "op://rbiv7rvkkrsdlpcrz3bmv7nmcu/kttdw7r3jp6rir7rtgkwk2a22q/ACTION_GXFS_WEBSERVER_SSH_HOST"
31+
ACTION_GXFS_WEBSERVER_SSH_PORT: "op://rbiv7rvkkrsdlpcrz3bmv7nmcu/kttdw7r3jp6rir7rtgkwk2a22q/ACTION_GXFS_WEBSERVER_SSH_PORT"
32+
ACTION_GXFS_WEBSERVER_SSH_USER: "op://rbiv7rvkkrsdlpcrz3bmv7nmcu/kttdw7r3jp6rir7rtgkwk2a22q/ACTION_GXFS_WEBSERVER_SSH_USER"
33+
ACTION_GXFS_WEBSERVER_SSH_PRIVATE_KEY: "op://rbiv7rvkkrsdlpcrz3bmv7nmcu/kttdw7r3jp6rir7rtgkwk2a22q/ACTION_GXFS_WEBSERVER_SSH_PRIVATE_KEY"
34+
35+
- name: executing remote ssh commands using password
36+
uses: appleboy/ssh-action@master
37+
with:
38+
host: ${{ env.ACTION_GXFS_WEBSERVER_SSH_HOST }}
39+
username: ${{ env.ACTION_GXFS_WEBSERVER_SSH_USER }}
40+
key: ${{ env.ACTION_GXFS_WEBSERVER_SSH_PRIVATE_KEY }}
41+
port: ${{ env.ACTION_GXFS_WEBSERVER_SSH_PORT }}
42+
script: |
43+
./mdip_org_website_updater.sh

Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
PHONY: help
2+
3+
help: ## This help.
4+
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
5+
6+
clean:
7+
rm -rf generated/
8+
9+
setup:
10+
pip3 install --force-reinstall -r requirements.txt && \
11+
pip3 install git+https://${MATERIAL_INSIDER_GITHUB_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git
12+
13+
serve: clean
14+
@echo "Starting MkDocs server..."
15+
@trap 'echo "Stopping MkDocs server..."; pkill -f "mkdocs serve"' SIGINT SIGTERM; \
16+
mkdocs serve -f config/en/mkdocs.yml --dev-addr 127.0.0.1:8000 --watch overrides
17+
18+
build: clean
19+
mkdir -p generated # Ensure the folder exists
20+
mkdocs build -f config/en/mkdocs.yml --clean
21+
22+
killserve:
23+
pkill -f "mkdocs serve"

0 commit comments

Comments
 (0)