Skip to content

Commit

Permalink
ci: Update CI to filter update path
Browse files Browse the repository at this point in the history
  • Loading branch information
oxyno-zeta committed Jul 3, 2021
1 parent a1189d9 commit 7cd0e45
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 6 deletions.
42 changes: 38 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,37 @@ on:
- "github-pages"
pull_request: {}
jobs:
changes:
runs-on: ubuntu-latest
outputs:
go: ${{ steps.filter.outputs.go }}
config: ${{ steps.filter.outputs.config }}
docker: ${{ steps.filter.outputs.docker }}
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
id: filter
with:
token: ${{ secrets.GITHUB_TOKEN }}
filters: |
go:
- '**/*.go'
- 'go.mod'
- 'go.sum'
config:
- '.github/workflows/ci.yml'
- '.goreleaser.yml'
- '.golangci.yaml'
- 'Makefile'
docker:
- 'Dockerfile'
lint:
if: |
(github.repository == 'oxyno-zeta/s3-proxy')
(needs.changes.outputs.go == 'true') ||
(needs.changes.outputs.config == 'true')
runs-on: ubuntu-latest
needs:
- changes
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
Expand All @@ -17,9 +44,11 @@ jobs:
- run: make code/lint
build:
if: |
(github.repository == 'oxyno-zeta/s3-proxy')
(needs.changes.outputs.go == 'true') ||
(needs.changes.outputs.config == 'true')
runs-on: ubuntu-latest
needs:
- changes
- lint
steps:
- uses: actions/checkout@v2
Expand All @@ -29,9 +58,11 @@ jobs:
- run: make code/build
build-cross:
if: |
(github.repository == 'oxyno-zeta/s3-proxy')
(needs.changes.outputs.go == 'true') ||
(needs.changes.outputs.config == 'true')
runs-on: ubuntu-latest
needs:
- changes
- lint
steps:
- uses: actions/checkout@v2
Expand All @@ -41,9 +72,12 @@ jobs:
- run: make code/build-cross
test:
if: |
(github.repository == 'oxyno-zeta/s3-proxy')
(needs.changes.outputs.go == 'true') ||
(needs.changes.outputs.config == 'true') ||
(needs.changes.outputs.docker == 'true')
runs-on: ubuntu-latest
needs:
- changes
- lint
steps:
- uses: actions/checkout@v2
Expand Down
25 changes: 23 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,30 @@ on:
- "github-pages"
pull_request: {}
jobs:
changes:
runs-on: ubuntu-latest
outputs:
md: ${{ steps.filter.outputs.md }}
config: ${{ steps.filter.outputs.config }}
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
id: filter
with:
token: ${{ secrets.GITHUB_TOKEN }}
filters: |
md:
- '**/*.md'
config:
- '.github/workflows/docs.yml'
- 'mkdocs.yml'
docs-build:
if: |
(github.repository == 'oxyno-zeta/s3-proxy')
(needs.changes.outputs.md == 'true') ||
(needs.changes.outputs.config == 'true')
runs-on: ubuntu-latest
needs:
- changes
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
Expand All @@ -20,8 +40,9 @@ jobs:
docs-deploy:
needs:
- docs-build
- changes
if: |
(github.repository == 'oxyno-zeta/s3-proxy') &&
((needs.changes.outputs.md == 'true') || (needs.changes.outputs.config == 'true')) &&
(github.ref == 'refs/heads/master')
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit 7cd0e45

Please # to comment.