Skip to content

Commit

Permalink
ci: further separation of docker build actions
Browse files Browse the repository at this point in the history
  • Loading branch information
TyIsI committed May 21, 2024
1 parent 13adff1 commit 149bdd2
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 23 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/docker-build-only.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Docker Image CI (Build Only)

on:
pull_request:
branches: ["main", "master", "trunk"]

jobs:
build-only:
if: ${{ github.event_name == 'pull_request' }}

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Docker metadata
id: meta
uses: docker/metadata-action@v5

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,8 @@ on:
push:
branches: ["main", "master", "trunk"]
tags: ["v*"]
pull_request:
branches: ["main", "master", "trunk"]

jobs:
build-only:
if: ${{ github.event_name == 'pull_request' }}

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Docker metadata
id: meta
uses: docker/metadata-action@v5

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

build-push:
if: ${{ github.event_name != 'pull_request' }}

Expand Down

0 comments on commit 149bdd2

Please sign in to comment.