Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/fetch-rust-skins.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Fetch Rust Skins from Steam Marketplace

on:
schedule:
# Run every Thursday at 6:00 PM EST (UTC-5)
# In cron syntax: minute hour day-of-month month day-of-week
- cron: '0 23 * * 4' # 23:00 UTC = 18:00 EST, day 4 = Thursday
workflow_dispatch: # Allow manual triggering

jobs:
fetch-skins:
runs-on: ubuntu-latest
timeout-minutes: 60

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11' # Updated to newer Python version

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Fetch Rust skins
run: python scripts/fetch_rust_skins.py --clear --max-items 15000 --timeout 2400
env:
STEAM_API_KEY: ${{ secrets.STEAM_API_KEY }}
continue-on-error: false # Fail the workflow if the script fails.

- name: Commit and push changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add data/skins.json
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "Update Rust skins data [skip ci]"
git push
fi
73 changes: 73 additions & 0 deletions .github/workflows/fetch-vm-skins-and-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Fetch VM Skins and Merge Data

on:
schedule:
# Run every Thursday at 8:00 PM EST (UTC-5)
# In cron syntax: minute hour day-of-month month day-of-week
- cron: '0 1 * * 5' # 01:00 UTC Friday = 20:00 EST Thursday
workflow_dispatch: # Allow manual triggering
inputs:
vm_api_endpoint:
description: 'VM API endpoint URL'
required: true
type: string

jobs:
fetch-and-merge:
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Fetch VM skins data
run: |
# Get current date for filename
CURRENT_DATE=$(date +%Y-%m-%d)
echo "CURRENT_DATE=$CURRENT_DATE" >> $GITHUB_ENV

# Fetch data from VM API endpoint
if [ -n "${{ github.event.inputs.vm_api_endpoint }}" ]; then
VM_ENDPOINT="${{ github.event.inputs.vm_api_endpoint }}"
else
VM_ENDPOINT="${{ secrets.VM_API_ENDPOINT }}"
fi

echo "Fetching data from VM endpoint..."
curl -f -o "docs/public/data/exporter_skins-$CURRENT_DATE.json" "$VM_ENDPOINT"

if [ $? -eq 0 ]; then
echo "Successfully fetched VM data"
else
echo "Failed to fetch VM data"
exit 1
fi

- name: Run merge script
run: |
# Update merge script to use current date file
python scripts/merge_skins.py --date ${{ env.CURRENT_DATE }}

- name: Commit and push changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add docs/public/data/exporter_skins-${{ env.CURRENT_DATE }}.json
git add docs/public/data/merged_skins.json
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "Update VM skins and merged data [${{ env.CURRENT_DATE }}] [skip ci]"
git push
fi
113 changes: 113 additions & 0 deletions .github/workflows/glossary-automation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: Glossary Links Automation

on:
push:
branches: [ main, master, skins-implementation ]
paths:
- 'docs/**/*.md'
- 'scripts/glossary-linker.js'
- 'scripts/fix-broken-glossary-links.js'
- 'docs/glossary.md'
pull_request:
branches: [ main, master, skins-implementation ]
paths:
- 'docs/**/*.md'
- 'scripts/glossary-linker.js'
- 'scripts/fix-broken-glossary-links.js'
- 'docs/glossary.md'
workflow_dispatch: # Allow manual triggering

jobs:
update-glossary-links:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch full history for proper commit handling
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20.6.1' # Using the same version as specified in package.json
cache: 'npm'

- name: Install dependencies
run: |
npm ci

- name: Run glossary linker
run: |
echo "Running glossary linker to add references to documentation..."
npm run glossary-links

- name: Check for changes
id: verify-changed-files
run: |
if git diff --quiet; then
echo "No changes detected"
echo "changes=false" >> $GITHUB_OUTPUT
else
echo "Changes detected"
echo "changes=true" >> $GITHUB_OUTPUT
echo "Changed files:"
git diff --name-only
fi

- name: Format files with Prettier
if: steps.verify-changed-files.outputs.changes == 'true'
run: |
echo "Formatting files with Prettier..."
npm run format

- name: Commit and push changes
if: steps.verify-changed-files.outputs.changes == 'true'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action - Glossary Automation"
git add .
if git diff --staged --quiet; then
echo "No staged changes to commit"
else
git commit -m "🔗 Auto-update glossary links [skip ci]"
git push
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

validate-glossary-links:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: update-glossary-links
if: always() # Run even if the previous job fails

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20.6.1'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Validate glossary file exists
run: |
if [ ! -f "docs/glossary.md" ]; then
echo "❌ Error: docs/glossary.md not found!"
exit 1
else
echo "✅ Glossary file found"
fi

- name: Check for broken glossary references
run: |
echo "Checking for any potential issues with glossary references..."
# This will help identify if there are any malformed links
grep -r "glossary#" docs/ --include="*.md" | head -10 || echo "No glossary references found or command failed"
5 changes: 1 addition & 4 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,4 @@ package-lock.json

# Git files
.git
.husky

# Markdown files
*.md
.husky
4 changes: 3 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"files": "*.md",
"options": {
"parser": "markdown",
"proseWrap": "preserve"
"proseWrap": "preserve",
"printWidth": 100000,
"embeddedLanguageFormatting": "auto"
}
}
]
Expand Down
12 changes: 9 additions & 3 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,13 @@ export default defineConfig({
{ text: 'Guides', link: '/guides/' },
{ text: 'Core', link: '/core/' },
{ text: 'Hooks', link: '/hooks/' },
{ text: 'Glossary', link: '/glossary' },
{
text: 'Other',
items: [
{ text: 'Skins', link: '/skins' },
{ text: 'Glossary', link: '/glossary' },
],
},
],

sidebar: {
Expand Down Expand Up @@ -150,6 +156,6 @@ export default defineConfig({
},
},
sitemap: {
hostname: 'https://docs.oxidemod.com'
}
hostname: 'https://docs.oxidemod.com',
},
});
Loading