Skip to content

Commit

Permalink
ci: use right triggers for the workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
tboerger committed Oct 30, 2023
1 parent e09f8cb commit 8606aed
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 20 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
name: binaries

"on":
workflow_dispatch:
pull_request:
branches:
- master
push:
branches:
- master
tags:
- v*

Expand All @@ -13,7 +19,7 @@ jobs:
steps:
- name: Checkout source
id: source
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@v4

- name: Setup golang
id: golang
Expand All @@ -31,6 +37,7 @@ jobs:

- name: Sign release
id: gpgsign
if: startsWith(github.ref, 'refs/tags/')
uses: actionhippie/gpgsign@v1
with:
private_key: ${{ secrets.GNUPG_KEY }}
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
name: changes

"on":
workflow_dispatch:
pull_request:
branches:
- master
push:
branches:
- master
Expand All @@ -13,7 +17,7 @@ jobs:
steps:
- name: Checkout source
id: source
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@v4
with:
token: ${{ secrets.BOT_ACCESS_TOKEN }}

Expand All @@ -29,6 +33,7 @@ jobs:

- name: Commit changes
id: commit
if: github.event_name != 'pull_request'
uses: EndBug/add-and-commit@v9
with:
author_name: GitHub Actions
Expand All @@ -44,7 +49,7 @@ jobs:
steps:
- name: Checkout source
id: source
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@v4
with:
token: ${{ secrets.BOT_ACCESS_TOKEN }}

Expand All @@ -60,6 +65,7 @@ jobs:

- name: Commit changes
id: commit
if: github.event_name != 'pull_request'
uses: EndBug/add-and-commit@v9
with:
author_name: GitHub Actions
Expand All @@ -75,7 +81,7 @@ jobs:
steps:
- name: Checkout source
id: source
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@v4
with:
token: ${{ secrets.BOT_ACCESS_TOKEN }}

Expand All @@ -91,6 +97,7 @@ jobs:

- name: Commit changes
id: commit
if: github.event_name != 'pull_request'
uses: EndBug/add-and-commit@v9
with:
author_name: GitHub Actions
Expand Down
29 changes: 23 additions & 6 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
name: docker

"on":
workflow_dispatch:
pull_request:
branches:
- master
push:
branches:
- master
Expand All @@ -18,21 +22,25 @@ jobs:
- platform: linux/386
goos: linux
goarch: 386
tags: netgo
- platform: linux/amd64
goos: linux
goarch: amd64
- platform: linux/arm64
goos: linux
goarch: arm64
tags: netgo
- platform: linux/arm/6
goos: linux
goarch: arm
goarm: 6
tags: netgo
- platform: linux/arm64
goos: linux
goarch: arm64
tags: netgo

steps:
- name: Checkout source
id: source
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@v4

- name: Setup golang
id: golang
Expand All @@ -46,6 +54,7 @@ jobs:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
GOARM: ${{ matrix.goarm }}
TAGS: ${{ matrix.tags }}
run: make generate

- name: Run build
Expand All @@ -54,6 +63,7 @@ jobs:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
GOARM: ${{ matrix.goarm }}
TAGS: ${{ matrix.tags }}
run: make build

- name: Docker meta
Expand Down Expand Up @@ -128,11 +138,12 @@ jobs:
manifest:
runs-on: ubuntu-latest
needs: docker
if: github.event_name != 'pull_request'

steps:
- name: Checkout source
id: source
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@v4

- name: Hub tags
id: hubTags
Expand Down Expand Up @@ -171,6 +182,7 @@ jobs:
- name: Quay manifest
id: quay
if: github.event_name != 'pull_request'
uses: actionhippie/manifest@v1
with:
username: ${{ secrets.QUAY_USERNAME }}
Expand All @@ -182,6 +194,7 @@ jobs:

- name: Ghcr tags
id: ghcrTags
if: github.event_name != 'pull_request'
uses: docker/metadata-action@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -194,6 +207,7 @@ jobs:
- name: Ghcr manifest
id: ghcr
if: github.event_name != 'pull_request'
uses: actionhippie/manifest@v1
with:
username: ${{ github.actor }}
Expand All @@ -206,14 +220,16 @@ jobs:
readme:
runs-on: ubuntu-latest
needs: docker
if: github.event_name != 'pull_request'

steps:
- name: Checkout source
id: source
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@v4

- name: Hub readme
id: hub
if: github.event_name != 'pull_request'
uses: actionhippie/pushrm@v1
with:
provider: dockerhub
Expand All @@ -225,6 +241,7 @@ jobs:

- name: Quay readme
id: quay
if: github.event_name != 'pull_request'
uses: actionhippie/pushrm@v1
with:
provider: quay
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
name: docs

"on":
workflow_dispatch:
pull_request:
branches:
- master
push:
branches:
- master
Expand All @@ -13,7 +17,7 @@ jobs:
steps:
- name: Checkout source
id: source
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@v4

- name: Setup hugo
id: hugo
Expand All @@ -28,6 +32,7 @@ jobs:

- name: Deploy pages
id: deploy
if: github.event_name != 'pull_request'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/general.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
name: general

"on":
push:
workflow_dispatch:
pull_request:
branches:
- master
pull_request:
push:
branches:
- master

Expand All @@ -16,7 +17,7 @@ jobs:
steps:
- name: Checkout source
id: source
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@v4

- name: Setup golang
id: golang
Expand Down Expand Up @@ -50,7 +51,7 @@ jobs:

- name: Coverage report
id: codacy
if: github.ref == 'refs/heads/master'
if: github.event_name != 'pull_request'
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/kustomize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
name: kustomize

"on":
push:
workflow_dispatch:
pull_request:
branches:
- master
pull_request:
push:
branches:
- master

Expand All @@ -16,9 +17,7 @@ jobs:
steps:
- name: Checkout source
id: source
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
token: ${{ secrets.BOT_ACCESS_TOKEN }}
uses: actions/checkout@v4

- name: Generate manifest
id: kustomize
Expand Down

0 comments on commit 8606aed

Please sign in to comment.