mirror of
https://github.com/zabbix/zabbix-docker.git
synced 2025-01-16 02:28:22 +01:00
Update CI.yml
This commit is contained in:
parent
92a53fdef0
commit
2fabe6078d
55
.github/workflows/CI.yml
vendored
55
.github/workflows/CI.yml
vendored
@ -56,6 +56,26 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Install buildx
|
||||||
|
env:
|
||||||
|
DOCKER_CLI_EXPERIMENTAL: enabled
|
||||||
|
run: |
|
||||||
|
BUILDX_VERSION="0.4.2"
|
||||||
|
QEMU_TAG="latest"
|
||||||
|
mkdir -p ~/.docker/cli-plugins/
|
||||||
|
curl -L https://github.com/docker/buildx/releases/download/v${BUILDX_VERSION}/buildx-v${BUILDX_VERSION}.linux-amd64 \
|
||||||
|
-o ~/.docker/cli-plugins/docker-buildx
|
||||||
|
chmod +x ~/.docker/cli-plugins/docker-buildx
|
||||||
|
docker pull -q multiarch/qemu-user-static:latest
|
||||||
|
docker run --rm --privileged multiarch/qemu-user-static:${QEMU_TAG} --reset -p yes --credential yes
|
||||||
|
docker buildx create --name builder-${GITHUB_SHA::8} --driver docker-container --use
|
||||||
|
docker buildx inspect --bootstrap
|
||||||
|
docker info
|
||||||
|
docker buildx inspect
|
||||||
|
|
||||||
|
- name: Available platforms
|
||||||
|
run: docker buildx inspect | grep Platforms
|
||||||
|
|
||||||
- name: Prepare platform list
|
- name: Prepare platform list
|
||||||
id: platform
|
id: platform
|
||||||
run: |
|
run: |
|
||||||
@ -144,15 +164,38 @@ jobs:
|
|||||||
DOCKER_CLI_EXPERIMENTAL: enabled
|
DOCKER_CLI_EXPERIMENTAL: enabled
|
||||||
run: |
|
run: |
|
||||||
if [ ! -z "${{ steps.prepare_push.outputs.buildx_args }}" ]; then
|
if [ ! -z "${{ steps.prepare_push.outputs.buildx_args }}" ]; then
|
||||||
BUILDX_ARGS=="${{ steps.prepare_push.outputs.buildx_args }}"
|
BUILDX_ARGS="${{ steps.prepare_push.outputs.buildx_args }}"
|
||||||
elif [ ! -z "${{ steps.prepare_release.outputs.buildx_args }}" ]; then
|
elif [ ! -z "${{ steps.prepare_release.outputs.buildx_args }}" ]; then
|
||||||
BUILDX_ARGS=="${{ steps.prepare_release.outputs.buildx_args }}"
|
BUILDX_ARGS="${{ steps.prepare_release.outputs.buildx_args }}"
|
||||||
fi
|
fi
|
||||||
echo "docker buildx build --cache-to \"type=local,dest=/tmp/.buildx-cache\" \
|
|
||||||
--output \"type=image,push=false\" \
|
|
||||||
$BUILDX_ARGS"
|
|
||||||
|
|
||||||
- name: Continue
|
docker buildx build --cache-to "type=local,dest=/tmp/.buildx-cache" \
|
||||||
|
--output "type=image,push=false" \
|
||||||
|
$BUILDX_ARGS
|
||||||
|
|
||||||
|
- name: Docker Hub login
|
||||||
|
if: success()
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Push images from cache
|
||||||
|
if: success()
|
||||||
|
env:
|
||||||
|
DOCKER_CLI_EXPERIMENTAL: enabled
|
||||||
|
run: |
|
||||||
|
if [ ! -z "${{ steps.prepare_push.outputs.buildx_args }}" ]; then
|
||||||
|
BUILDX_ARGS="${{ steps.prepare_push.outputs.buildx_args }}"
|
||||||
|
elif [ ! -z "${{ steps.prepare_release.outputs.buildx_args }}" ]; then
|
||||||
|
BUILDX_ARGS="${{ steps.prepare_release.outputs.buildx_args }}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
docker buildx build --cache-from "type=local,src=/tmp/.buildx-cache" \
|
||||||
|
--output "type=image,push=false" \
|
||||||
|
$BUILDX_ARGS
|
||||||
|
|
||||||
|
- name: Inspect images
|
||||||
run: |
|
run: |
|
||||||
echo "::warning push - ${{ steps.prepare_push.outputs.buildx_args }}"
|
echo "::warning push - ${{ steps.prepare_push.outputs.buildx_args }}"
|
||||||
echo "::warning release - ${{ steps.prepare_release.outputs.buildx_args }}"
|
echo "::warning release - ${{ steps.prepare_release.outputs.buildx_args }}"
|
||||||
|
Loading…
Reference in New Issue
Block a user