Skip to content

Commit c2317e3

Browse files
authored
Update GH Actions workflow to only push to S3 on main and build/* (#35)
1 parent 8c8135e commit c2317e3

1 file changed

Lines changed: 15 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
name: CI
22

33
on:
4-
- push
5-
- pull_request
4+
push:
5+
branches:
6+
- main
7+
- 'build/**'
8+
pull_request:
69

710
concurrency:
811
group: ${{ github.workflow }}-${{ github.ref }}
@@ -39,16 +42,8 @@ jobs:
3942
- name: Run tests
4043
run: cargo test --all --release
4144

42-
all-checks-passed:
43-
name: All checks passed
44-
needs: [check, test]
45-
runs-on: ubuntu-24.04
46-
steps:
47-
- run: ":"
48-
4945
build:
5046
name: Build artifacts [${{ matrix.platform.name }}]
51-
if: github.event_name == 'push'
5247
strategy:
5348
matrix:
5449
platform:
@@ -145,10 +140,18 @@ jobs:
145140
if-no-files-found: error
146141
path: artifacts/brioche
147142

143+
all-checks-passed:
144+
name: All checks passed
145+
needs: [check, test, build]
146+
runs-on: ubuntu-24.04
147+
steps:
148+
- run: ":"
149+
148150
push:
149151
name: Push artifacts
150-
if: github.event_name == 'push' && github.repository == 'brioche-dev/brioche-runtime-utils'
151-
needs: [all-checks-passed, build]
152+
# Only push artifacts when pushing to `main` and `build/*` branches
153+
if: github.event_name == 'push' && github.repository == 'brioche-dev/brioche-runtime-utils' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/'))
154+
needs: [all-checks-passed]
152155
runs-on: ubuntu-24.04
153156
steps:
154157
- name: Download artifacts (x86_64-linux)

0 commit comments

Comments
 (0)