Skip to content

Commit

Permalink
Filter github actions to be executed
Browse files Browse the repository at this point in the history
  • Loading branch information
aledbf committed Jul 3, 2020
1 parent d347f61 commit 9a94d63
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 4 deletions.
56 changes: 52 additions & 4 deletions .github/workflows/ci.yaml
Expand Up @@ -4,24 +4,48 @@ on:
pull_request:
branches:
- "*"

push:
branches:
- master

jobs:

changes:
runs-on: ubuntu-latest
outputs:
go: ${{ steps.filter.outputs.go }}
charts: ${{ steps.filter.outputs.charts }}
steps:
- name: Checkout
uses: actions/checkout@v1

- uses: dorny/paths-filter@v2.2.0
id: filter
with:
filters: |
go:
- '**/*.go'
- 'go.mod'
- 'go.sum'
- 'rootfs/**/*'
charts:
- 'charts/**/*'
build:
name: Build
runs-on: ubuntu-latest
if: ${{ needs.changes.outputs.go == 'true' }}

steps:
- name: Checkout
uses: actions/checkout@v1

- name: Set up Go 1.14
id: go
uses: actions/setup-go@v1
with:
go-version: 1.14
id: go

- name: Checkout
uses: actions/checkout@v1

- name: Set up Docker Buildx
id: buildx
Expand Down Expand Up @@ -63,10 +87,24 @@ jobs:
name: docker.tar.gz
path: docker.tar.gz

helm:
name: Helm
runs-on: ubuntu-latest
if: ${{ needs.changes.outputs.charts == 'true' }}

steps:
- name: Checkout
uses: actions/checkout@v1

- name: Test Chart
run: |
./hack/verify-chart-lint.sh
kubernetes:
name: Kubernetes
runs-on: ubuntu-latest
needs: build
if: ${{ needs.changes.outputs.go == 'true' }}
strategy:
matrix:
k8s: [v1.14.10, v1.15.11, v1.16.9, v1.17.5, v1.18.4]
Expand All @@ -75,6 +113,16 @@ jobs:
- name: Checkout
uses: actions/checkout@v1

- uses: dorny/paths-filter@v2.2.0
id: filter
with:
filters: |
go:
- '**/*.go'
- 'go.mod'
- 'go.sum'
- 'rootfs/**/*'
- name: cache
uses: actions/download-artifact@v2
with:
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/main.yaml
Expand Up @@ -13,7 +13,15 @@ jobs:
- name: Checkout master
uses: actions/checkout@v1

- uses: dorny/paths-filter@v2.2.0
id: filter
with:
filters: |
docs:
- 'docs/**/*'
- name: Deploy docs
if: steps.filter.outputs.docs == 'true'
uses: ./.github/actions/mkdocs
env:
PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
Expand All @@ -25,13 +33,22 @@ jobs:
- name: Checkout master
uses: actions/checkout@v1

- uses: dorny/paths-filter@v2.2.0
id: filter
with:
filters: |
chart:
- 'charts/ingress-nginx/Chart.yaml'
- name: Setup
if: steps.filter.outputs.chart == 'true'
shell: bash
run: |
git config --global user.name "$GITHUB_ACTOR"
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Run chart-releaser
if: steps.filter.outputs.chart == 'true'
uses: helm/chart-releaser-action@v1.0.0-rc.2
env:
CR_TOKEN: "${{ secrets.PERSONAL_TOKEN }}"

0 comments on commit 9a94d63

Please sign in to comment.