Skip to content

Commit

Permalink
ci: 👷 split into main vs PR build CI workflows (#174)
Browse files Browse the repository at this point in the history
## Description

These changes are made because the styling and documenting can only be
done on non-main branches. So this adds two builds.
  • Loading branch information
lwjohnst86 authored Dec 19, 2024
1 parent c5a1edd commit 3f8183a
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 18 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/build-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
pull_request:
branches: main

name: Build package

permissions: read-all

jobs:
style:
uses: ./.github/workflows/reusable-style.yaml
permissions:
contents: write
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}

document:
uses: ./.github/workflows/reusable-document.yaml
needs: style
permissions:
contents: write
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}

cran-check:
uses: ./.github/workflows/reusable-cran-check.yaml
needs: document
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}

pkgdown:
uses: ./.github/workflows/reusable-pkgdown.yaml
needs: cran-check
permissions:
contents: write
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
18 changes: 0 additions & 18 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
on:
push:
branches: main
pull_request:
branches: main
release:
types: [published]

Expand All @@ -13,24 +11,8 @@ name: Build package
permissions: read-all

jobs:
style:
uses: ./.github/workflows/reusable-style.yaml
permissions:
contents: write
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}

document:
uses: ./.github/workflows/reusable-document.yaml
needs: style
permissions:
contents: write
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}

cran-check:
uses: ./.github/workflows/reusable-cran-check.yaml
needs: document
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}

Expand Down

0 comments on commit 3f8183a

Please sign in to comment.