Add workflow triggers and job condition
This commit is contained in:
parent
de3b33d488
commit
8456a74773
1 changed files with 6 additions and 3 deletions
9
.github/workflows/flaskr-ci.yaml
vendored
9
.github/workflows/flaskr-ci.yaml
vendored
|
|
@ -2,9 +2,11 @@ name: Build and Test
|
||||||
on:
|
on:
|
||||||
workflow_dispatch: # Enables manually running the workflow
|
workflow_dispatch: # Enables manually running the workflow
|
||||||
push:
|
push:
|
||||||
# pull_request:
|
banches:
|
||||||
# branches:
|
- feature/**
|
||||||
# - main
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
jobs:
|
jobs:
|
||||||
tests:
|
tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
@ -36,6 +38,7 @@ jobs:
|
||||||
# Build Docker image in a separate job so that it's not tainted by cached build/test files
|
# Build Docker image in a separate job so that it's not tainted by cached build/test files
|
||||||
build-image:
|
build-image:
|
||||||
needs: tests
|
needs: tests
|
||||||
|
if: github.event_name == "pull_request"
|
||||||
permissions:
|
permissions:
|
||||||
# Required permission to push images with the built-in GITHUB_TOKEN
|
# Required permission to push images with the built-in GITHUB_TOKEN
|
||||||
packages: write
|
packages: write
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue