CI: filter ci by paths, docs ci test vs build, update PR template

pull/2109/head
shamoon 1 year ago
parent 56f46ae85c
commit a1e023e240

@ -6,7 +6,7 @@ Please include a summary of the change. Screenshots and / or videos can also be
*** Please see the development guidelines for new widgets: https://gethomepage.dev/en/more/development/#service-widget-guidelines
*** If you do not follow these guidelines your PR will likely be closed without review.
New service widgets should include example(s) of relevant relevant API output as well as a PR to the docs for the new widget.
New service widgets should include example(s) of relevant relevant API output as well updates to the docs for the new widget.
-->
Closes # (issue)
@ -20,11 +20,12 @@ What type of change does your PR introduce to Homepage?
- [ ] New service widget
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Documentation only
- [ ] Other (please explain)
## Checklist:
- [ ] If adding a service widget or a change that requires it, I have added corresponding documentation.
- [ ] If adding a service widget or a change that requires it, I have added corresponding documentation changes.
- [ ] If adding a new widget I have reviewed the [guidelines](https://gethomepage.dev/en/more/development/#service-widget-guidelines).
- [ ] If applicable, I have checked that all tests pass with e.g. `pnpm lint`.
- [ ] If applicable, I have tested my code for new features & regressions on both mobile & desktop devices, using the latest version of major browsers.

@ -12,8 +12,14 @@ on:
branches: [ "main" ]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
paths-ignore:
- 'docs/**'
- 'mkdocs.yml'
pull_request:
branches: [ "main" ]
paths-ignore:
- 'docs/**'
- 'mkdocs.yml'
env:
# Use docker.io for Docker Hub if empty
@ -24,7 +30,8 @@ env:
jobs:
build:
if: github.repository == 'benphelps/homepage'
name: Docker Build & Push
if: github.repository == 'benphelps/homepage'
runs-on: self-hosted
permissions:
contents: read
@ -40,7 +47,7 @@ jobs:
# Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer
- name: Install cosign
if: github.event_name != 'pull_request'
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@main
with:
cosign-release: 'v1.13.1' # optional

@ -4,14 +4,43 @@ on:
push:
tags: [ 'v*.*.*' ]
branches: ['main']
paths:
- 'docs/**'
- 'mkdocs.yml'
pull_request:
paths:
- 'docs/**'
- 'mkdocs.yml'
workflow_dispatch:
permissions:
contents: write
jobs:
test:
name: Test Build
if: github.repository == 'benphelps/homepage' && github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: sudo apt-get install pngquant
- run: pip install mike
- run: pip install mkdocs-material
- name: Test Docs Build
run: MKINSIDERS=false mkdocs build
deploy:
if: github.repository == 'benphelps/homepage'
name: Build & Deploy
if: github.repository == 'benphelps/homepage' && github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@ -40,10 +69,10 @@ jobs:
git checkout gh-pages
git pull origin gh-pages
git checkout main
- name: Mike Deploy for Main
- name: Docs Deploy for Main
if: github.ref == 'refs/heads/main'
run: MKINSIDERS=true mike deploy --update --push ${{github.ref_name}}
- name: Mike Deploy for Tags
- name: Docs Deploy for Tags
if: github.ref != 'refs/heads/main'
run: MKINSIDERS=true mike deploy --update --push ${{github.ref_name}} latest
env:

Loading…
Cancel
Save