Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 5 additions & 22 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,10 @@ name: 🏗️ Build PR
on:
pull_request: ~

env:
stream: "pr-${{ github.event.pull_request.number }}"

jobs:
build:
name: Build Docker image
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [ '20', '22', '24' ]

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

- name: 🐋 Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: 🏗️ Build Docker image
uses: docker/bake-action@v6
env:
NODE_VERSION: ${{ matrix.node }}
STREAM: ${{ env.stream }}
uses: ./.github/workflows/build-push.yml
with:
stream: "pr-${{ github.event.pull_request.number }}"
push: true
secrets: inherit
1 change: 0 additions & 1 deletion .github/workflows/build-push-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ jobs:
uses: ./.github/workflows/build-push.yml
with:
stream: latest
push: true
secrets: inherit
1 change: 0 additions & 1 deletion .github/workflows/build-push-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ jobs:
uses: ./.github/workflows/build-push.yml
with:
stream: stable
push: true
secrets: inherit
17 changes: 4 additions & 13 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,14 @@ name: 🏗️ Build and Push
on:
workflow_call:
inputs:
runs_on:
type: string
default: ubuntu-latest
description: The image to run the jobs.
stream:
type: string
default: latest
description: The stream to build (e.g latest or stable).
push:
type: boolean
default: false
description: Whether to push the built image to the registry.
default: true
description: Push the images up to the container registries.

secrets:
DOCKERHUB_USERNAME:
Expand All @@ -25,12 +21,7 @@ on:
jobs:
build:
name: Build Docker image
runs-on: ${{ inputs.runs_on }}
permissions:
packages: write
contents: read
attestations: write
id-token: write
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
Expand All @@ -56,7 +47,7 @@ jobs:
- name: 🏗️ Build and push Docker image
uses: docker/bake-action@v6
env:
PHP_VERSION: ${{ matrix.php }}
NODE_VERSION: ${{ matrix.node }}
STREAM: ${{ inputs.stream }}
with:
push: ${{ inputs.push }}
1 change: 1 addition & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ group "default" {
target "prod" {
inherits = ["_common"]
context = "."
target = "run"

contexts = {
from_image = "docker-image://node:${NODE_VERSION}-alpine${ALPINE_VERSION}"
Expand Down
Loading