From 88135a16d7652b72f399709c63ad6a20c32eb062 Mon Sep 17 00:00:00 2001 From: Francesco Lodolo Date: Mon, 22 Jan 2024 15:42:12 +0100 Subject: [PATCH] Update workflows --- .github/workflows/deploy.yaml | 21 +++++++++++++-------- .github/workflows/linter.yaml | 12 +++++++----- book.toml | 1 + 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 3210059b..d58af87d 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -5,23 +5,28 @@ on: # only for the default branch. push: branches: - main + - main # Allows you to run this workflow manually from the Actions tab workflow_dispatch: jobs: fetch: runs-on: ubuntu-latest + env: + MDBOOK_VERSION: v0.4.36 + MDBOOKTOC_VERSION: 0.14.2 steps: - name: Clone repository - uses: actions/checkout@v3 - - name: Install Rust packages + uses: actions/checkout@v4 + - name: Install mdbook and mdbook--toc run: | - curl --proto '=https' --tlsv1.2 -sSf https://rossmacarthur.github.io/install/crate.sh | bash -s -- --repo "rust-lang/mdBook" --bin mdbook --to ~/.cargo/bin - curl --proto '=https' --tlsv1.2 -sSf https://rossmacarthur.github.io/install/crate.sh | bash -s -- --repo "badboy/mdbook-toc" --to ~/.cargo/bin + mkdir installed-bins + curl -Lf "https://github.com/rust-lang/mdBook/releases/download/$MDBOOK_VERSION/mdbook-$MDBOOK_VERSION-x86_64-unknown-linux-gnu.tar.gz" | tar -xz --directory=./installed-bins + curl -Lf "https://github.com/badboy/mdbook-toc/releases/download/$MDBOOKTOC_VERSION/mdbook-toc-$MDBOOKTOC_VERSION-x86_64-unknown-linux-gnu.tar.gz" | tar -xz --directory=./installed-bins + echo `pwd`/installed-bins >> $GITHUB_PATH - name: Install gh-pages run: | - npm install gh-pages@"~4.0.0" + npm install gh-pages@"~6.1.1" - name: Build book run: | mdbook --version @@ -29,8 +34,8 @@ jobs: mdbook build - name: Set Git config run: | - git config --global user.email 'flodolo@users.noreply.github.com' - git config --global user.name 'Francesco Lodolo [:flod]' + git config --global user.email "actions@users.noreply.github.com" + git config --global user.name 'Automation' git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY - name: Deploy to GitHub pages run: | diff --git a/.github/workflows/linter.yaml b/.github/workflows/linter.yaml index f9e2a3cf..0885bf26 100644 --- a/.github/workflows/linter.yaml +++ b/.github/workflows/linter.yaml @@ -4,9 +4,11 @@ on: # Triggers the workflow on push or pull request events but # only for the default branch push: - branches: [ main ] + branches: + - main pull_request: - branches: [ main ] + branches: + - main # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -16,9 +18,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Setup Node.js environment - uses: actions/setup-node@v2.1.2 + uses: actions/setup-node@v4 - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Run markdown linter run: | npm install @@ -26,7 +28,7 @@ jobs: - name: Set up Python 3 uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.11' - name: Check SUMMARY.md run: | python .github/scripts/check_summary.py src diff --git a/book.toml b/book.toml index 71d2b2b9..e6b4ac70 100644 --- a/book.toml +++ b/book.toml @@ -10,3 +10,4 @@ renderer = ["html"] [output.html] git-repository-url = "https://github.com/mozilla-l10n/documentation/" edit-url-template = "https://github.com/mozilla-l10n/documentation/edit/main/{path}" +no-section-label = true