mirror of
https://github.com/docker/build-push-action.git
synced 2026-07-04 22:25:35 +00:00
Compare commits
5 Commits
22fab6b495
...
408f7d5030
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
408f7d5030 | ||
|
|
356f5313f1 | ||
|
|
311cfdadd6 | ||
|
|
9006f61740 | ||
|
|
767df53376 |
48
.github/workflows/.e2e-run.yml
vendored
48
.github/workflows/.e2e-run.yml
vendored
@ -19,12 +19,11 @@ on:
|
|||||||
slug:
|
slug:
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
username_secret:
|
secrets:
|
||||||
|
username:
|
||||||
required: false
|
required: false
|
||||||
type: string
|
password:
|
||||||
password_secret:
|
|
||||||
required: false
|
required: false
|
||||||
type: string
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
HARBOR_VERSION: v2.7.0
|
HARBOR_VERSION: v2.7.0
|
||||||
@ -37,13 +36,12 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
buildx_version:
|
||||||
-
|
- latest
|
||||||
buildx_version: latest
|
- https://github.com/docker/buildx.git#master
|
||||||
buildkit_image: moby/buildkit:buildx-stable-1
|
buildkit_image:
|
||||||
-
|
- moby/buildkit:buildx-stable-1
|
||||||
buildx_version: https://github.com/docker/buildx.git#master
|
- moby/buildkit:master
|
||||||
buildkit_image: moby/buildkit:master
|
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
@ -80,11 +78,11 @@ jobs:
|
|||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v4
|
uses: docker/metadata-action@v4
|
||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY_SLUG || inputs.slug }}
|
images: ${{ inputs.slug }}
|
||||||
tags: |
|
tags: |
|
||||||
type=ref,event=branch,enable=${{ matrix.buildx_version == 'latest' && matrix.buildkit_image == 'moby/buildkit:buildx-stable-1' }}
|
type=ref,event=branch
|
||||||
type=ref,event=tag,enable=${{ matrix.buildx_version == 'latest' && matrix.buildkit_image == 'moby/buildkit:buildx-stable-1' }}
|
type=ref,event=tag
|
||||||
type=raw,gh-runid-${{ github.run_id }}
|
type=raw,value=${{ inputs.tag }},enable=${{ inputs.tag != '' }}
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v2
|
||||||
@ -92,20 +90,20 @@ jobs:
|
|||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.buildx_version }}
|
version: ${{ inputs.buildx-version || matrix.buildx_version }}
|
||||||
config: /tmp/buildkitd.toml
|
config: /tmp/buildkitd.toml
|
||||||
buildkitd-flags: --debug --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host
|
buildkitd-flags: --debug --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host
|
||||||
driver-opts: |
|
driver-opts: |
|
||||||
image=${{ matrix.buildkit_image }}
|
image=${{ inputs.buildkit-image || matrix.buildkit_image }}
|
||||||
network=host
|
network=host
|
||||||
-
|
-
|
||||||
name: Login to Registry
|
name: Login to Registry
|
||||||
if: github.event_name != 'pull_request' && (env.REGISTRY_USER || inputs.username_secret) != ''
|
if: github.event_name != 'pull_request' && secrets.username != ''
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
registry: ${{ env.REGISTRY_FQDN || inputs.registry }}
|
registry: ${{ inputs.registry }}
|
||||||
username: ${{ env.REGISTRY_USER || secrets[inputs.username_secret] }}
|
username: ${{ secrets.username }}
|
||||||
password: ${{ env.REGISTRY_PASSWORD || secrets[inputs.password_secret] }}
|
password: ${{ secrets.password }}
|
||||||
-
|
-
|
||||||
name: Build and push
|
name: Build and push
|
||||||
uses: ./
|
uses: ./
|
||||||
@ -116,14 +114,14 @@ jobs:
|
|||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
cache-from: type=registry,ref=${{ env.REGISTRY_SLUG || inputs.slug }}:master
|
cache-from: type=registry,ref=${{ inputs.slug }}:master
|
||||||
cache-to: type=inline
|
cache-to: type=inline
|
||||||
-
|
-
|
||||||
name: Inspect image
|
name: Inspect image
|
||||||
run: |
|
run: |
|
||||||
docker pull ${{ env.REGISTRY_SLUG || inputs.slug }}:${{ steps.meta.outputs.version }}
|
docker pull ${{ inputs.slug }}:${{ steps.meta.outputs.version }}
|
||||||
docker image inspect ${{ env.REGISTRY_SLUG || inputs.slug }}:${{ steps.meta.outputs.version }}
|
docker image inspect ${{ inputs.slug }}:${{ steps.meta.outputs.version }}
|
||||||
-
|
-
|
||||||
name: Check manifest
|
name: Check manifest
|
||||||
run: |
|
run: |
|
||||||
docker buildx imagetools inspect ${{ env.REGISTRY_SLUG || inputs.slug }}:${{ steps.meta.outputs.version }} --format '{{json .}}'
|
docker buildx imagetools inspect ${{ inputs.slug }}:${{ steps.meta.outputs.version }} --format '{{json .}}'
|
||||||
|
|||||||
39
.github/workflows/e2e.yml
vendored
39
.github/workflows/e2e.yml
vendored
@ -2,6 +2,18 @@ name: e2e
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
buildx-version:
|
||||||
|
description: 'Buildx version or Git context'
|
||||||
|
default: 'latest'
|
||||||
|
required: false
|
||||||
|
buildkit-image:
|
||||||
|
description: 'BuildKit image'
|
||||||
|
default: 'moby/buildkit:buildx-stable-1'
|
||||||
|
required: false
|
||||||
|
tag:
|
||||||
|
description: 'Additional tag to push'
|
||||||
|
required: false
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 10 * * *'
|
- cron: '0 10 * * *'
|
||||||
push:
|
push:
|
||||||
@ -12,7 +24,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
uses: ./.github/workflows/.e2e-run.yml
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@ -99,12 +111,19 @@ jobs:
|
|||||||
name: Nexus
|
name: Nexus
|
||||||
id: nexus
|
id: nexus
|
||||||
type: local
|
type: local
|
||||||
with:
|
steps:
|
||||||
id: ${{ matrix.id }}
|
-
|
||||||
type: ${{ matrix.type }}
|
name: Set up env
|
||||||
name: ${{ matrix.name }}
|
if: matrix.type == 'local'
|
||||||
registry: ${{ matrix.registry }}
|
run: |
|
||||||
slug: ${{ matrix.slug }}
|
cat ./.github/e2e/${{ matrix.id }}/env >> $GITHUB_ENV
|
||||||
username_secret: ${{ matrix.username_secret }}
|
-
|
||||||
password_secret: ${{ matrix.password_secret }}
|
uses: ./.github/workflows/.e2e-run.yml
|
||||||
secrets: inherit
|
with:
|
||||||
|
id: ${{ matrix.id }}
|
||||||
|
type: ${{ matrix.type }}
|
||||||
|
name: ${{ matrix.name }}
|
||||||
|
registry: ${{ env.REGISTRY_FQDN || matrix.registry }}
|
||||||
|
slug: ${{ env.REGISTRY_SLUG || matrix.slug }}
|
||||||
|
username: ${{ env.REGISTRY_USER || secrets[matrix.username_secret] }}
|
||||||
|
password: ${{ env.REGISTRY_PASSWORD || secrets[matrix.password_secret] }}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user