mirror of
https://github.com/awesome-selfhosted/awesome-selfhosted-data.git
synced 2026-03-11 08:55:24 +00:00
tools/github actions: automate daily metadata update + commit/push changes after update
- automate lint/build on changes - only run metadata updates from GH actions schedules, not from main CI workflow - ref. https://github.com/nodiscc/hecat/issues/26 - ref. https://github.com/awesome-selfhosted/awesome-selfhosted-data/issues/14 - ref. https://github.com/awesome-selfhosted/awesome-selfhosted-data/issues/4
This commit is contained in:
parent
4f8f2ecac8
commit
2eb4deb308
6 changed files with 40 additions and 32 deletions
13
.github/workflows/ci.yml
vendored
13
.github/workflows/ci.yml
vendored
|
|
@ -1,5 +1,3 @@
|
|||
name: awesome-selfhosted CI
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
|
@ -10,12 +8,9 @@ env:
|
|||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
ci:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: process
|
||||
run: make process
|
||||
- name: export
|
||||
run: make export
|
||||
- uses: actions/checkout@v3
|
||||
- run: make awesome_lint
|
||||
- run: make export
|
||||
|
|
|
|||
18
.github/workflows/update-metadata.yml
vendored
18
.github/workflows/update-metadata.yml
vendored
|
|
@ -1,12 +1,20 @@
|
|||
name: daily metadata update
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '31 12 * * 1'
|
||||
- cron: '55 20 * * 1'
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
|
||||
jobs:
|
||||
test_schedule:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: update projects metadata
|
||||
run: make process
|
||||
- uses: actions/checkout@v3
|
||||
- run: make update_metadata
|
||||
- name: commit and push changes
|
||||
run: |
|
||||
git config user.name awesome-selfhosted-bot
|
||||
git config user.email github-actions@github.com
|
||||
git add software/ tags/ platforms/ licenses*.yml
|
||||
git diff-index --quiet HEAD || git commit -m "[bot] update projects metadata"
|
||||
git push
|
||||
|
|
|
|||
9
.hecat.awesome_lint.yml
Normal file
9
.hecat.awesome_lint.yml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
steps:
|
||||
- name: data against awesome-selfhosted guidelines
|
||||
module: processors/awesome_lint
|
||||
module_options:
|
||||
source_directory: ./
|
||||
items_in_delegate_to_fatal: False
|
||||
licenses_files:
|
||||
- licenses.yml
|
||||
- licenses-nonfree.yml
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
steps:
|
||||
- name: update metadata from Github API
|
||||
module: processors/github_metadata
|
||||
module_options:
|
||||
source_directory: ./
|
||||
gh_metadata_only_missing: True
|
||||
|
||||
- name: check data against awesome-selfhosted guidelines
|
||||
module: processors/awesome_lint
|
||||
module_options:
|
||||
source_directory: ./
|
||||
items_in_delegate_to_fatal: False
|
||||
licenses_files:
|
||||
- licenses.yml
|
||||
- licenses-nonfree.yml
|
||||
6
.hecat.update_metadata.yml
Normal file
6
.hecat.update_metadata.yml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
steps:
|
||||
- name: update metadata from Github API
|
||||
module: processors/github_metadata
|
||||
module_options:
|
||||
source_directory: ./
|
||||
gh_metadata_only_missing: True
|
||||
11
Makefile
11
Makefile
|
|
@ -17,10 +17,15 @@ import: install
|
|||
source .venv/bin/activate && \
|
||||
hecat --config .hecat.import.yml
|
||||
|
||||
.PHONY: process # apply automatic processing (gather github metadata)
|
||||
process: install
|
||||
.PHONY: update_metadata # update metadata from project repositories/API
|
||||
update_metadata: install
|
||||
source .venv/bin/activate && \
|
||||
hecat --config .hecat.process.yml
|
||||
hecat --config .hecat.update_metadata.yml
|
||||
|
||||
.PHONY: awesome_lint # check data against awesome-selfhosted guidelines
|
||||
awesome_lint: install
|
||||
source .venv/bin/activate && \
|
||||
hecat --config .hecat.awesome_lint.yml
|
||||
|
||||
.PHONY: export # export markdown singlepage document from yaml data
|
||||
export: install
|
||||
|
|
|
|||
Loading…
Reference in a new issue