Filter ci actions by path
This commit is contained in:
parent
e890e6c46c
commit
27542609af
27
.github/workflows/docker-publish.yml
vendored
27
.github/workflows/docker-publish.yml
vendored
@ -23,8 +23,31 @@ env:
|
||||
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
# Required permissions
|
||||
permissions:
|
||||
pull-requests: read
|
||||
# Set job outputs to values from filter step
|
||||
outputs:
|
||||
src: ${{ steps.filter.outputs.src }}
|
||||
steps:
|
||||
- uses: dorny/paths-filter@v2
|
||||
id: filter
|
||||
with:
|
||||
filters: |
|
||||
src:
|
||||
- 'src/**'
|
||||
- 'Dockerfile'
|
||||
- 'docker-entrypoint.sh'
|
||||
- 'package.json'
|
||||
- 'package-lock.json'
|
||||
- 'pnpm-lock.yaml'
|
||||
- 'tailwind.config.js'
|
||||
- 'postcss.config.js'
|
||||
build:
|
||||
if: github.repository == 'benphelps/homepage'
|
||||
needs: changes
|
||||
if: needs.changes.outputs.src == 'true' && github.repository == 'benphelps/homepage'
|
||||
runs-on: self-hosted
|
||||
permissions:
|
||||
contents: read
|
||||
@ -40,7 +63,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
|
||||
|
||||
21
.github/workflows/docs-publish.yml
vendored
21
.github/workflows/docs-publish.yml
vendored
@ -11,9 +11,25 @@ permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
# Required permissions
|
||||
permissions:
|
||||
pull-requests: read
|
||||
# Set job outputs to values from filter step
|
||||
outputs:
|
||||
docs: ${{ steps.filter.outputs.docs }}
|
||||
steps:
|
||||
- uses: dorny/paths-filter@v2
|
||||
id: filter
|
||||
with:
|
||||
filters: |
|
||||
docs:
|
||||
- 'docs/**'
|
||||
test:
|
||||
needs: changes
|
||||
name: Test Build
|
||||
if: github.repository == 'benphelps/homepage' && github.event_name == 'pull_request'
|
||||
if: needs.changes.outputs.docs == 'true' && github.repository == 'benphelps/homepage' && github.event_name == 'pull_request'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@ -35,8 +51,9 @@ jobs:
|
||||
- name: Test Docs Build
|
||||
run: MKINSIDERS=true mkdocs build
|
||||
deploy:
|
||||
needs: changes
|
||||
name: Build & Deploy
|
||||
if: github.repository == 'benphelps/homepage' && github.event_name != 'pull_request'
|
||||
if: needs.changes.outputs.docs == 'true' && github.repository == 'benphelps/homepage' && github.event_name != 'pull_request'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
Loading…
Reference in New Issue
Block a user