Skip to content

Commit

Permalink
ci: refactor browserstack.yml to avoid repeating if and building
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Feb 28, 2023
1 parent d00baf9 commit 6f41d07
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/browserstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,20 @@ jobs:
PR: ${{ github.event.number }}
REPO: ${{ github.event.repository.full_name }}

build:
gate:
runs-on: ubuntu-latest
if: ${{ !startsWith(github.event_name, 'pull_request') || (github.event_name == 'pull_request_target' && github.event.label.name == 'trigger-browserstack') }}
steps:
- run: echo The Show Must Go On

build:
needs:
- gate
uses: ./.github/workflows/build.yml

cert:
if: ${{ !startsWith(github.event_name, 'pull_request') || (github.event_name == 'pull_request_target' && github.event.label.name == 'trigger-browserstack') }}
needs:
- gate
uses: panva/.github/.github/workflows/cert-for-browserstack.yml@main
with:
subdomain: jose
Expand All @@ -41,7 +49,6 @@ jobs:
needs:
- build
- cert
if: ${{ !startsWith(github.event_name, 'pull_request') || (github.event_name == 'pull_request_target' && github.event.label.name == 'trigger-browserstack') }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down

0 comments on commit 6f41d07

Please sign in to comment.