Add workflow triggers and job condition

This commit is contained in:
ted-cdw 2023-02-23 16:10:36 -05:00
parent de3b33d488
commit 8456a74773

View file

@ -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