Merge pull request #567 from jontze/dependabot/npm_and_yarn/types/nod… #760
This file contains 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: CI | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
test: | |
name: Test | |
uses: ./.github/workflows/test.yml | |
secrets: inherit | |
build: | |
needs: | |
- test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node and Dependencies | |
uses: ./.github/actions/setup | |
- name: Build | |
run: yarn build | |
- name: Cache build output | |
uses: actions/cache@v4 | |
with: | |
path: ./dist | |
key: build-cache-${{ github.run_id }}-${{ github.run_attempt }} | |
integration_test: | |
needs: [build] | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, ubuntu-22.04] | |
version: [18, 20] | |
runs-on: ${{ matrix.os }} | |
name: Test action with Node v${{ matrix.version }} and ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Restore build cache | |
id: build-restore | |
uses: actions/cache@v4 | |
with: | |
path: ./dist | |
key: build-cache-${{ github.run_id }}-${{ github.run_attempt }} | |
- name: Ensure cache is restored | |
if: steps.build-restore.outputs.cache-hit != 'true' | |
run: exit 1 | |
- name: Run local action with latest tags | |
uses: ./ | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
use-linkcheck: true | |
use-mermaid: true | |
use-toc: true | |
use-opengh: true | |
use-admonish: true | |
use-katex: true | |
- name: Test mdBook binary | |
run: mdbook --version | |
- name: Test mdbook-linkcheck binary | |
run: mdbook-linkcheck --version | |
- name: Test mdbook-mermaid binary | |
run: mdbook-mermaid --version | |
- name: Test mdbook-toc binary | |
run: mdbook-toc --version | |
- name: Test mdbook-open-on-gh binary | |
run: mdbook-open-on-gh --version | |
- name: Test mdbook-admonish binary | |
run: mdbook-admonish --version | |
- name: Test mdbook-katex binary | |
run: mdbook-katex --version | |
release: | |
needs: [integration_test] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Restore build cache | |
id: build-restore | |
uses: actions/cache@v4 | |
with: | |
path: ./dist | |
key: build-cache-${{ github.run_id }}-${{ github.run_attempt }} | |
- name: Ensure cache is restored | |
if: steps.build-restore.outputs.cache-hit != 'true' | |
run: exit 1 | |
- name: Add Change and commit | |
uses: EndBug/[email protected] | |
with: | |
add: "./dist --force" | |
default_author: github_actions | |
message: "chore: Generate dist files [skip ci]" | |
- name: Setup Node and Dependencies | |
uses: ./.github/actions/setup | |
- name: Run Semantic Release | |
run: yarn semantic-release | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |