Separate PR & Merge Workflows (#225)

Signed-off-by: Russell Troxel <russell@troxel.io>
This commit is contained in:
Russell Troxel 2023-10-08 07:29:13 -07:00 committed by GitHub
parent b8b7cc6be3
commit 4d71594773
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 11 deletions

View File

@ -6,6 +6,11 @@ inputs:
token:
description: Github token
required: true
push:
description: Push Images to GHCR
type: boolean
required: false
default: true
runs:
using: composite
@ -39,14 +44,14 @@ runs:
username: ${{ github.actor }}
password: ${{ inputs.token }}
- name: Build and Push
- name: Build Docker Image
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
push: ${{ fromJSON(inputs.push) }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |

View File

@ -1,13 +1,10 @@
---
name: ci
name: On Merge
on:
push:
pull_request:
types:
- opened
- reopened
- synchronize
branches:
- master
jobs:
tests:
@ -21,8 +18,6 @@ jobs:
release-image:
runs-on: ubuntu-latest
needs: tests
if: github.event_name == 'push' && github.ref_name == 'master'
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4

19
.github/workflows/on-pr.yml vendored Normal file
View File

@ -0,0 +1,19 @@
---
name: On Pull Request
on:
pull_request:
types:
- opened
- reopened
- synchronize
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
- name: Tests
uses: ./.github/actions/tests

View File

@ -1,5 +1,5 @@
---
name: release
name: Versioned Release
on:
push: