Update Git-Catalogue #18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update Git-Catalogue | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout 🛎️ | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Use Node.js 20.14.0 | |
| uses: actions/setup-node@v1 | |
| with: | |
| node-version: "20.14.0" | |
| - name: Build 🔨 | |
| run: | | |
| git clone https://github.com/azerothcore/git-catalogue | |
| cd git-catalogue | |
| export NODE_OPTIONS=--openssl-legacy-provider | |
| npm ci --no-audit --no-fund | |
| # Inject AzerothCore production config used by the Angular app at runtime | |
| mkdir -p src/assets | |
| cat > src/assets/config.json << 'JSON' | |
| { | |
| "perPage": 100, | |
| "pageSize": 8, | |
| "usePreGeneratedFile": true, | |
| "preGeneratedFileUrl": "/data/catalogue.json", | |
| "globalSearch": true, | |
| "tabs": { | |
| "All Modules": { | |
| "topic": "azerothcore-module", | |
| "org": "azerothcore", | |
| "path": "/module" | |
| }, | |
| "Premium Modules": { | |
| "topic": "azerothcore-module+ac-premium", | |
| "org": "azerothcore", | |
| "path": "/module+premium" | |
| }, | |
| "Tools": { | |
| "topic": "azerothcore-tools", | |
| "org": "azerothcore", | |
| "path": "/tools" | |
| }, | |
| "Lua scripts": { | |
| "topic": "azerothcore-lua", | |
| "org": "azerothcore", | |
| "path": "/lua" | |
| }, | |
| "SQL": { | |
| "topic": "azerothcore-sql", | |
| "org": "azerothcore", | |
| "path": "/sql" | |
| } | |
| } | |
| } | |
| JSON | |
| # Build production bundles (ensures correct environment and hashing) | |
| npm run build -- --configuration=production | |
| # Copy and rename hashed JS bundles to fixed names expected by the layout | |
| mkdir -p ../javascripts/catalogue | |
| cp "$(ls dist/git-catalogue/runtime-es2015*.js | head -n1)" ../javascripts/catalogue/runtime-es2015.js | |
| cp "$(ls dist/git-catalogue/runtime-es5*.js | head -n1)" ../javascripts/catalogue/runtime-es5.js | |
| cp "$(ls dist/git-catalogue/polyfills-es2015*.js | head -n1)" ../javascripts/catalogue/polyfills-es2015.js | |
| cp "$(ls dist/git-catalogue/polyfills-es5*.js | head -n1)" ../javascripts/catalogue/polyfills-es5.js | |
| cp "$(ls dist/git-catalogue/vendor-es2015*.js | head -n1)" ../javascripts/catalogue/vendor-es2015.js || true | |
| cp "$(ls dist/git-catalogue/vendor-es5*.js | head -n1)" ../javascripts/catalogue/vendor-es5.js || true | |
| cp "$(ls dist/git-catalogue/scripts*.js | head -n1)" ../javascripts/catalogue/scripts.js || true | |
| cp "$(ls dist/git-catalogue/main-es2015*.js | head -n1)" ../javascripts/catalogue/main-es2015.js | |
| cp "$(ls dist/git-catalogue/main-es5*.js | head -n1)" ../javascripts/catalogue/main-es5.js | |
| # Copy CSS into the expected filename | |
| cp "$(ls dist/git-catalogue/styles*.css | head -n1)" ../stylesheets/catalogue_style.css | |
| # Copy Angular assets so /assets/config.json is served by Pages | |
| mkdir -p ../assets | |
| rsync -a dist/git-catalogue/assets/ ../assets/ | |
| cd .. | |
| rm -rf git-catalogue | |
| - name: Deploy 🚀 | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| branch: master | |
| folder: . |