diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38225148..994ea8ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 8043f11b..66671c46 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -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 @@ -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: