Skip to content

Commit

Permalink
Multibranch workflows (#2)
Browse files Browse the repository at this point in the history
* workflow test, init different workflows

* inherit secrets from other workflow

* exclude main branch from tests on push condition, because they are called explicitely as part of build workflow both on push and pull_request
  • Loading branch information
zostaw authored Dec 2, 2023
1 parent a79353b commit 533b6ab
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/push_dockerhub.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
name: Dockerhub Push
name: Dockerhub Release

on:
workflow_run:
workflows: ["Run Tests"]
branches: [main]
types:
- completed
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build_and_push:
needs: test
tests:
uses: ./.github/workflows/test_docker.yml
secrets: inherit
push_dockerhub:
needs: [tests]
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/test_docker.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Run Tests

on: [push, pull_request]
on:
push:
branches-ignore:
- main
workflow_call:

jobs:
test_page_initiation:
Expand Down

0 comments on commit 533b6ab

Please sign in to comment.