mirror of
https://github.com/ThePhaseless/Byparr.git
synced 2025-03-15 01:40:21 +08:00
try fixing new build
This commit is contained in:
parent
d3ec88eeff
commit
b0da587c39
30
.github/workflows/docker-publish.yml
vendored
30
.github/workflows/docker-publish.yml
vendored
@ -43,9 +43,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
cache-from: type=gha,scope=buildkit-x64
|
cache-from: type=gha,scope=x64
|
||||||
pull: true
|
pull: true
|
||||||
cache-to: type=gha,mode=max,scope=buildkit-x64
|
cache-to: type=gha,mode=max,scope=x64
|
||||||
target: test
|
target: test
|
||||||
|
|
||||||
build:
|
build:
|
||||||
@ -90,21 +90,9 @@ jobs:
|
|||||||
tags: |
|
tags: |
|
||||||
type=ref,event=branch
|
type=ref,event=branch
|
||||||
type=ref,event=pr
|
type=ref,event=pr
|
||||||
type=semver,pattern={{version}}
|
type=semver,pattern={{version}}-${{ matrix.platform == 'linux/amd64' && 'amd64' || 'arm64' }}
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
|
||||||
type=semver,pattern={{major}}
|
|
||||||
type=raw,enable=${{ github.ref_type == 'tag' }}, value=latest
|
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
|
|
||||||
# Get platform specific variables
|
|
||||||
- name: Set platform-specific variables
|
|
||||||
id: platform-vars
|
|
||||||
run: |
|
|
||||||
PLATFORM="${{ matrix.platform }}"
|
|
||||||
PLATFORM_SUFFIX="${PLATFORM//\//-}"
|
|
||||||
echo "platform_suffix=${PLATFORM_SUFFIX}" >> $GITHUB_OUTPUT
|
|
||||||
echo "cache_scope=buildkit-${PLATFORM_SUFFIX}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
# Build and push Docker image with platform-specific tag
|
# Build and push Docker image with platform-specific tag
|
||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
id: build-and-push
|
id: build-and-push
|
||||||
@ -113,18 +101,18 @@ jobs:
|
|||||||
context: .
|
context: .
|
||||||
pull: true
|
pull: true
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}-${{ steps.platform-vars.outputs.platform_suffix }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
platforms: ${{ matrix.platform }}
|
platforms: ${{ matrix.platform }}
|
||||||
cache-from: type=gha,scope=${{ steps.platform-vars.outputs.cache_scope }}
|
cache-from: type=gha,scope=${{ matrix.platform }}
|
||||||
cache-to: type=gha,mode=max,scope=${{ steps.platform-vars.outputs.cache_scope }}
|
cache-to: type=gha,mode=max,scope=${{ matrix.platform }}
|
||||||
build-args: GITHUB_BUILD=true,VERSION=${{ github.ref_name }}
|
build-args: GITHUB_BUILD=true,VERSION=${{ github.ref_name }}
|
||||||
|
|
||||||
# Sign the platform specific image
|
# Sign the platform specific image
|
||||||
- name: Sign the published Docker image
|
- name: Sign the published Docker image
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
env:
|
env:
|
||||||
TAGS: ${{ steps.meta.outputs.tags }}-${{ steps.platform-vars.outputs.platform_suffix }}
|
TAGS: ${{ steps.meta.outputs.tags }}
|
||||||
DIGEST: ${{ steps.build-and-push.outputs.digest }}
|
DIGEST: ${{ steps.build-and-push.outputs.digest }}
|
||||||
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
|
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
|
||||||
|
|
||||||
@ -173,8 +161,8 @@ jobs:
|
|||||||
for TAG in $TAGS; do
|
for TAG in $TAGS; do
|
||||||
# Create manifest list and push it
|
# Create manifest list and push it
|
||||||
docker buildx imagetools create -t $TAG \
|
docker buildx imagetools create -t $TAG \
|
||||||
$TAG-linux-amd64 \
|
$TAG-amd64 \
|
||||||
$TAG-linux-arm64
|
$TAG-arm64
|
||||||
done
|
done
|
||||||
|
|
||||||
- name: Install cosign
|
- name: Install cosign
|
||||||
|
Loading…
x
Reference in New Issue
Block a user