mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-07 06:08:48 +00:00
CI: filter ci by paths, docs ci test vs build, update PR template
This commit is contained in:
parent
56f46ae85c
commit
a1e023e240
3 changed files with 44 additions and 7 deletions
11
.github/workflows/docker-publish.yml
vendored
11
.github/workflows/docker-publish.yml
vendored
|
@ -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
|
||||
|
|
35
.github/workflows/docs-publish.yml
vendored
35
.github/workflows/docs-publish.yml
vendored
|
@ -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…
Add table
Add a link
Reference in a new issue