diff --git a/.github/workflows/build_and_publish.yml b/.github/workflows/build_and_publish.yml index 6579466..db052a1 100644 --- a/.github/workflows/build_and_publish.yml +++ b/.github/workflows/build_and_publish.yml @@ -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 diff --git a/.github/workflows/build_image_develop.yml b/.github/workflows/build_image_develop.yml index 612e090..e1eeb47 100644 --- a/.github/workflows/build_image_develop.yml +++ b/.github/workflows/build_image_develop.yml @@ -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 }} diff --git a/.github/workflows/build_image_release.yml b/.github/workflows/build_image_release.yml index 044d7fa..b0ff4dd 100644 --- a/.github/workflows/build_image_release.yml +++ b/.github/workflows/build_image_release.yml @@ -1,16 +1,15 @@ name: Build release image on: - schedule: - - 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: diff --git a/Dockerfile b/Dockerfile index 9dc8834..7f8565e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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