Website Wiki Build #374
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: Website Wiki Build | |
| on: | |
| push: | |
| branches: [main] | |
| schedule: | |
| - cron: '0 6 * * *' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Sync docs from upstream repos | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: python .github/scripts/sync_wiki_docs.py | |
| - name: Update Portfolio Data | |
| run: | | |
| git fetch origin portfolio-data | |
| git show origin/portfolio-data:portfolio-archive.json > portfolio-archive.json 2>/dev/null || echo '{"videos": []}' > portfolio-archive.json | |
| git show origin/portfolio-data:portfolio-recent.json > portfolio-recent.json 2>/dev/null || echo '{"videos": []}' > portfolio-recent.json | |
| pip install yt-dlp | |
| python .github/scripts/update_portfolio.py | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| ARCHIVE_BLOB=$(git hash-object -w portfolio-archive.json) | |
| RECENT_BLOB=$(git hash-object -w portfolio-recent.json) | |
| TREE_HASH=$(printf "100644 blob $ARCHIVE_BLOB\tportfolio-archive.json\n100644 blob $RECENT_BLOB\tportfolio-recent.json" | git mktree) | |
| PARENT_COMMIT=$(git rev-parse origin/portfolio-data) | |
| if [ "$(git rev-parse $PARENT_COMMIT^{tree})" = "$TREE_HASH" ]; then | |
| echo "Aucun changement dans les données." | |
| else | |
| COMMIT_HASH=$(git commit-tree $TREE_HASH -p $PARENT_COMMIT -m "auto: update portfolio data [skip ci]") | |
| git push origin $COMMIT_HASH:refs/heads/portfolio-data | |
| fi | |
| - name: Generate blog posts from releases | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: python .github/scripts/sync_blog_posts.py | |
| - name: Generate portfolio blog posts | |
| run: python .github/scripts/sync_blog_portfolio.py | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| cache-dependency-path: package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build Docusaurus | |
| run: npm run build -w wiki | |
| - name: Prepare Blog assets | |
| run: | | |
| mkdir -p Blog/assets/img | |
| - name: Build Blog | |
| run: npm run build -w blog | |
| - name: Assemble site | |
| env: | |
| FORMSPREE_ENDPOINT: ${{ secrets.FORMSPREE_ENDPOINT }} | |
| run: | | |
| mkdir -p _site/wiki _site/news _site/assets | |
| cp index.html _site/index.html | |
| cp -r assets/. _site/assets/ | |
| if [ -d Portfolio ]; then | |
| mkdir -p _site/Portfolio | |
| cp -r Portfolio/. _site/Portfolio/ | |
| if [ -n "${FORMSPREE_ENDPOINT}" ]; then | |
| sed -i "s|%%FORMSPREE_ENDPOINT%%|${FORMSPREE_ENDPOINT}|g" _site/Portfolio/assets/js/main.js | |
| fi | |
| fi | |
| cp -r Wiki/build/. _site/wiki/ | |
| cp -r Blog/build/. _site/news/ | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: _site | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |