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
66 changes: 23 additions & 43 deletions .github/workflows/build_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,57 +24,37 @@ on:
description: docker registry access token
required: true

permissions:
contents: read

jobs:
build:
prepare:
runs-on: ubuntu-latest
outputs:
appTag: ${{ steps.get_meta.outputs.appTag }}
steps:
-
name: Checkout github repository
uses: actions/checkout@v6
with:
repository: ${{ vars.DOCKER_REPOSITORY }}
ref: ${{ inputs.imgBuild }}
-
name: Setup QEMU
uses: docker/setup-qemu-action@v4
with:
platforms: 'amd64,arm64,arm'
-
name: Setup Docker buildx
uses: docker/setup-buildx-action@v4
-
name: Get the docker image metadata
id: get_meta
run: |
appTag=$(basename ${{ inputs.appGitRefs }} | sed -e "s/^[vV]//")
echo "appTag=$appTag" >> $GITHUB_OUTPUT
-
name: Set the docker image metadata
id: set_meta
uses: docker/metadata-action@v6
with:
images: ${{ inputs.regLogin }}/librebooking
tags: |
type=raw,value=${{ steps.get_meta.outputs.appTag }},suffix=-${{ inputs.imgBuild }}
type=raw,value=${{ steps.get_meta.outputs.appTag }}
-
name: Log into registry
uses: docker/login-action@v4
with:
registry: ${{ inputs.regName }}
build:
needs: prepare
uses: docker/github-builder/.github/workflows/build.yml@v1
permissions:
contents: read
id-token: write
with:
output: image
push: true
platforms: linux/amd64,linux/arm64
meta-images: ${{ inputs.regLogin }}/librebooking
meta-tags: |
type=raw,value=${{ needs.prepare.outputs.appTag }},suffix=-${{ inputs.imgBuild }}
type=raw,value=${{ needs.prepare.outputs.appTag }}
secrets:
registry-auths: |
- registry: ${{ inputs.regName }}
username: ${{ inputs.regLogin }}
password: ${{ secrets.REGISTRY_TOKEN }}
-
name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v7
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v7
build-args: |
VERSION_PHP=${{ vars.VERSION_PHP }}
VERSION_COMPOSER=${{ vars.VERSION_COMPOSER }}
APP_GH_REF=${{ inputs.appGitRefs }}
APP_GH_ADD_SHA=${{ inputs.appAddSha }}
tags: ${{ steps.set_meta.outputs.tags }}
push: true
16 changes: 8 additions & 8 deletions .github/workflows/build_image_develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ on:
workflow_dispatch:

jobs:
build-develop:
uses: ./.github/workflows/build_and_publish.yml
with:
appGitRefs: develop
appAddSha: true
imgBuild: ${{ vars.IMAGE_BUILD }}
regName: ${{ vars.REGISTRY_URL }}
regLogin: ${{ vars.REGISTRY_LOGIN }}
build-develop:
uses: ./.github/workflows/build_and_publish.yml
with:
appGitRefs: develop
appAddSha: true
imgBuild: ${{ vars.VERSION_LB_IMG }}
regName: ${{ vars.REGISTRY_URL }}
regLogin: ${{ vars.REGISTRY_LOGIN }}
secrets:
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
7 changes: 3 additions & 4 deletions .github/workflows/build_image_release.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
name: Build release image

on:
schedule:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the schedule being removed?

- cron: '0 1 * * 6'
workflow_dispatch:

jobs:
build-stable:
uses: ./.github/workflows/build_and_publish.yml
with:
appGitRefs: ${{ vars.VERSION_LIBREBOOKING }}
imgBuild: ${{ vars.IMAGE_BUILD }}
appGitRefs: ${{ vars.VERSION_LB_APP }}
appAddSha: false
imgBuild: ${{ vars.VERSION_LB_IMG }}
regName: ${{ vars.REGISTRY_URL }}
regLogin: ${{ vars.REGISTRY_LOGIN }}
secrets:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG VERSION_PHP=8.3
ARG VERSION_PHP=8.5.7
ARG VERSION_COMPOSER=lts
ARG VERSION_GIT=2.52.0

Expand Down