Skip to content

Commit

Permalink
dev: checkout action v4 & sparse-checkout in GitHub workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
practicalli-johnny committed Nov 7, 2023
1 parent 556c394 commit e448a20
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 22 deletions.
10 changes: 1 addition & 9 deletions .github/workflows/changelog-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
name: Changelog Check
on:
pull_request:
paths-ignore:
- "README.md"
- "CHANGELOG.md"
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]

jobs:
Expand All @@ -18,19 +15,14 @@ jobs:
- run: echo "🐧 Job running on ${{ runner.os }} server"
- run: echo "🐙 Using ${{ github.ref }} branch from ${{ github.repository }} repository"

# Git Checkout
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
sparse-checkout: |
CHANGELOG.md
- run: echo "🐙 Sparse Checkout of ${{ github.repository }} repository to the CI runner."
with:
token: "${{ secrets.PAT || secrets.GITHUB_TOKEN }}"
- run: echo "🐙 ${{ github.repository }} repository was cloned to the runner."
- run: echo "🐙 ${{ github.repository }} repository sparse-checkout to the CI runner."

# Changelog Enforcer
- name: Changelog Enforcer
uses: dangoslen/changelog-enforcer@v3
with:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/megalinter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ name: MegaLinter
on:
workflow_dispatch:
pull_request:
branches: [ main ]
branches: [main]
push:
branches: [ main ]
branches: [main]

# Run Linters in parallel
# Cancel running job if new job is triggered
Expand All @@ -30,6 +30,7 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v4
with:
token: "${{ secrets.PAT || secrets.GITHUB_TOKEN }}"
fetch-depth: 0
sparse-checkout: |
docs
Expand Down
31 changes: 21 additions & 10 deletions .github/workflows/publish-book.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ on:
workflow_run:
workflows:
- "MegaLinter"
paths-ignore:
- README.md
- CHANGELOG.md
- .gitignore
paths:
- "docs/**"
- "includes/**"
- "overrides/**"
- "mkdocs.yaml"
branches:
- main
types:
Expand All @@ -21,27 +22,37 @@ permissions:
contents: write

jobs:
deploy:
publish-book:
name: MkDocs Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: echo "🚀 Job automatically triggered by ${{ github.event_name }}"
- run: echo "🐧 Job running on ${{ runner.os }} server"
- run: echo "🐙 Using ${{ github.ref }} branch from ${{ github.repository }} repository"

- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
sparse-checkout: |
docs
overrides
- run: echo "🐙 Sparse Checkout of ${{ github.repository }} repository to the CI runner."
- uses: actions/setup-python@v4
- run: echo "🐙 ${{ github.repository }} repository sparse-checkout to the CI runner."
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: actions/cache@v3

- name: Cache
uses: actions/cache@v3
with:
key: ${{ github.ref }}
path: .cache

- run: pip install mkdocs-material mkdocs-callouts mkdocs-glightbox mkdocs-git-revision-date-localized-plugin mkdocs-redirects pillow cairosvg
- run: mkdocs gh-deploy --force
- run: echo "🐙 ."

# Summary and status
- run: echo "🎨 MkDocs book workflow ended"
- run: echo "🎨 MkDocs Publish Book workflow completed"
- run: echo "🍏 Job status is ${{ job.status }}."
2 changes: 1 addition & 1 deletion .github/workflows/scheduled-version-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- run: echo "🐙 Using ${{ github.ref }} branch from ${{ github.repository }} repository"

- name: "Checkout code"
uses: actions/checkout@v3
uses: actions/checkout@v4
- run: echo "🐙 ${{ github.repository }} repository was cloned to the runner."

- name: "Antq Check versions"
Expand Down

0 comments on commit e448a20

Please sign in to comment.