|
|
|
@ -131,36 +131,25 @@ jobs:
|
|
|
|
|
- name: Setup Docker buildx
|
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
|
|
|
|
|
|
- name: Build and push Docker image using bake
|
|
|
|
|
- name: Build and push Docker image
|
|
|
|
|
id: build-and-push
|
|
|
|
|
uses: docker/bake-action@v6
|
|
|
|
|
uses: docker/build-push-action@v6
|
|
|
|
|
with:
|
|
|
|
|
source: .
|
|
|
|
|
context: .
|
|
|
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
|
|
|
files: |
|
|
|
|
|
./docker-bake.hcl
|
|
|
|
|
cwd://${{ steps.meta.outputs.bake-file }}
|
|
|
|
|
targets: homepage
|
|
|
|
|
|
|
|
|
|
# - name: Build and push Docker image
|
|
|
|
|
# id: build-and-push
|
|
|
|
|
# uses: docker/build-push-action@v6
|
|
|
|
|
# with:
|
|
|
|
|
# context: .
|
|
|
|
|
# push: ${{ github.event_name != 'pull_request' }}
|
|
|
|
|
# tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
|
# labels: ${{ steps.meta.outputs.labels }}
|
|
|
|
|
# build-args: |
|
|
|
|
|
# CI=true
|
|
|
|
|
# BUILDTIME=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
|
|
|
|
|
# VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
|
|
|
|
|
# REVISION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
|
|
|
|
|
# platforms: linux/amd64,linux/arm64
|
|
|
|
|
# cache-from: type=local,src=/tmp/.buildx-cache
|
|
|
|
|
# cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
|
|
|
|
|
|
|
|
|
|
# # https://github.com/docker/build-push-action/issues/252 / https://github.com/moby/buildkit/issues/1896
|
|
|
|
|
# - name: Move cache
|
|
|
|
|
# run: |
|
|
|
|
|
# rm -rf /tmp/.buildx-cache
|
|
|
|
|
# mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
|
|
|
build-args: |
|
|
|
|
|
CI=true
|
|
|
|
|
BUILDTIME=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
|
|
|
|
|
VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
|
|
|
|
|
REVISION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
|
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
|
cache-from: type=local,src=/tmp/.buildx-cache
|
|
|
|
|
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
|
|
|
|
|
|
|
|
|
|
# https://github.com/docker/build-push-action/issues/252 / https://github.com/moby/buildkit/issues/1896
|
|
|
|
|
- name: Move cache
|
|
|
|
|
run: |
|
|
|
|
|
rm -rf /tmp/.buildx-cache
|
|
|
|
|
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
|
|
|
|