Skip to content
Merged
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: 17 additions & 10 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ jobs:
matrix:
images: ${{ fromJson(vars.IMAGES) }}
steps:
- name: Get PR branch
if: github.event.issue.pull_request
id: pr-branch
uses: xt0rted/pull-request-comment-branch@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

Expand All @@ -42,7 +47,7 @@ jobs:
- uses: actions/checkout@v4
if: ( github.event.issue.pull_request && contains(github.event.comment.body, '/build') )
with:
ref: refs/pull/${{ github.event.issue.number }}/head
ref: ${{ steps.pr-branch.outputs.head_ref }}

- name: Login to registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
Expand All @@ -57,25 +62,26 @@ jobs:
with:
images: |
${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.images }}
context: ${{ github.event.issue.pull_request && 'workflow' || 'git' }}
tags: |
# PR images (not merged): pr-<num>
type=ref,event=pr,enable=${{ github.event.pull_request.merged == false }}
# Tag with the PR base branch name on merge
type=raw,value=${{ github.event.pull_request.base.ref }},enable=${{ github.event.pull_request.merged == true }}
# Manual/scheduled runs tag by branch ref (for whichever release branch the run targets)
# Manual/scheduled runs tag by branch ref
type=ref,event=branch,enable=${{ contains(fromJson('["schedule", "workflow_dispatch"]'), github.event_name) }}
# Comment-triggered builds: pr-<num>
type=raw,event=default,value=pr-${{ github.event.issue.number }},enable=${{ github.event.issue.pull_request != null }}
# Supported release branches
type=raw,value=5.x,enable=${{ github.ref == 'refs/heads/5.x' || github.event.pull_request.base.ref == '5.x' }}
type=raw,value=6.x,enable=${{ github.ref == 'refs/heads/6.x' || github.event.pull_request.base.ref == '6.x' }}
type=raw,value=7.x,enable=${{ github.ref == 'refs/heads/7.x' || github.event.pull_request.base.ref == '7.x' }}
type=raw,value=pr-${{ github.event.issue.number }},enable=${{ github.event.issue.pull_request != null }}
# Supported release branches - use the fetched branch name for comments
type=raw,value=5.x,enable=${{ (github.ref_name == '5.x' || github.event.pull_request.base.ref == '5.x') && ! steps.pr-branch.outputs.head_ref }}
type=raw,value=6.x,enable=${{ (github.ref_name == '6.x' || github.event.pull_request.base.ref == '6.x') && ! steps.pr-branch.outputs.head_ref }}
type=raw,value=7.x,enable=${{ (github.ref_name == '7.x' || github.event.pull_request.base.ref == '7.x') && ! steps.pr-branch.outputs.head_ref }}
# Always add an immutable sha tag
type=raw,value=sha-${{ github.sha }}
type=raw,value=sha-${{ github.event.pull_request.head.sha || steps.pr-branch.outputs.head_sha || github.sha }}
labels: |
maintainer=Digital Victoria
maintainer=Victorian Department of Government Services
repository=${{ github.repositoryUrl }}
org.opencontainers.image.authors=Digital Victoria
org.opencontainers.image.authors=Victorian Department of Government Services
org.opencontainers.image.source=https://github.com/${{ github.repository }}/tree/${{ (contains(fromJson('["opened","synchronize"]'), github.event.action)) && github.head_ref || github.event.action == 'closed' && github.base_ref || github.ref_name }}/images/${{ matrix.images }}/Dockerfile
org.opencontainers.image.title=${{ matrix.images }}
org.opencontainers.image.description=${{ matrix.images }} image for Bay container platform
Expand All @@ -101,6 +107,7 @@ jobs:
uses: docker/bake-action@v5
with:
push: true
source: .
files: |
./gh-actions-bake.hcl
${{ steps.meta.outputs.bake-file }}
Expand Down
1 change: 1 addition & 0 deletions images/opensearch/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM uselagoon/opensearch-2:latest

RUN for plugin in \
analysis-kuromoji \
ingest-attachment \
analysis-icu; do \
/usr/share/opensearch/bin/opensearch-plugin install $plugin; \
done
3 changes: 3 additions & 0 deletions images/php/Dockerfile.fpm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ COPY log-fatals.php /bay
# Change worker pool from dynamic to static. Change default value to 24.
RUN sed -i "s/pm = dynamic/pm = static/" /usr/local/etc/php-fpm.d/www.conf
ENV PHP_FPM_PM_MAX_CHILDREN=24
COPY php-fpm.conf /usr/local/etc/php-fpm.d/bay-php-fpm.conf

ARG TZ=Australia/Melbourne
RUN apk add --no-cache tzdata \
Expand All @@ -46,6 +47,7 @@ ONBUILD ARG BAY_SESSION_COOKIE_LIFETIME=28800
ONBUILD ARG BAY_SESSION_STRICT=1
ONBUILD ARG BAY_SESSION_SID_LEN=256
ONBUILD ARG BAY_SESSION_SID_BITS=6
ONBUILD ARG BAY_PHP_FPM_REQUEST_SLOWLOG_TIMEOUT=10s

ONBUILD ENV BAY_DISABLE_FUNCTIONS $BAY_DISABLE_FUNCTIONS
ONBUILD ENV BAY_UPLOAD_LIMIT $BAY_UPLOAD_LIMIT
Expand All @@ -55,5 +57,6 @@ ONBUILD ENV BAY_SESSION_COOKIE_LIFETIME $BAY_SESSION_COOKIE_LIFETIME
ONBUILD ENV BAY_SESSION_STRICT $BAY_SESSION_STRICT
ONBUILD ENV BAY_SESSION_SID_LEN $BAY_SESSION_SID_LEN
ONBUILD ENV BAY_SESSION_SID_BITS $BAY_SESSION_SID_BITS
ONBUILD ENV BAY_PHP_FPM_REQUEST_SLOWLOG_TIMEOUT $BAY_PHP_FPM_REQUEST_SLOWLOG_TIMEOUT

ONBUILD RUN /bay/bay-php-config.sh
3 changes: 3 additions & 0 deletions images/php/php-fpm.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[www]
request_slowlog_timeout = ${BAY_PHP_FPM_REQUEST_SLOWLOG_TIMEOUT:-0}
slowlog = /proc/1/fd/2
Loading