Update theme components #11
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: Update theme components | |
# Controls when the workflow will run | |
on: | |
schedule: | |
# Update theme components automatically every week | |
- cron: "0 0 * * 0" | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
update-deps: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v3 | |
with: | |
hugo-version: latest | |
extended: true | |
- name: Update theme components | |
run: | | |
hugo mod get -u | |
hugo mod tidy | |
- name: Generate hugo-fixit component list | |
uses: hugo-fixit/action-component-list@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
comment_tag_name: HUGO_FIXIT_COMPONENTS | |
readme_path: 'README.md,README.en.md' | |
exclude_repos: 'fixit-bundle' | |
template: "- [{$repo.name}]({$repo.html_url})\\\n {$repo.description}" | |
- name: Commit changes | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
id: auto-commit | |
with: | |
commit_user_name: Cell[bot] | |
commit_user_email: lrhx@users.noreply.github.com | |
commit_author: Cell[bot] <lrhx@users.noreply.github.com> | |
commit_message: ":arrow_up: Chore(deps): update theme components" | |
- name: Get latest tag | |
uses: actions-ecosystem/action-get-latest-tag@v1 | |
id: get-latest-tag | |
- name: Bump semver | |
uses: actions-ecosystem/action-bump-semver@v1 | |
id: bump-semver | |
with: | |
current_version: ${{ steps.get-latest-tag.outputs.tag }} | |
# major, premajor, minor, preminor, patch, prepatch, prerelease | |
level: patch | |
- name: Push tag | |
uses: actions-ecosystem/action-push-tag@v1 | |
if: steps.auto-commit.outputs.changes_detected == 'true' | |
with: | |
tag: ${{ steps.bump-semver.outputs.new_version }} | |
message: ':bookmark: Chore(release): ${{ steps.bump-semver.outputs.new_version }}' |