2020-11-19 10:40:39 +01:00
|
|
|
name: e2e
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
2022-08-12 16:45:35 +02:00
|
|
|
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
|
2020-11-19 10:40:39 +01:00
|
|
|
schedule:
|
2021-11-16 07:19:27 +01:00
|
|
|
- cron: '0 10 * * *'
|
2020-11-19 10:40:39 +01:00
|
|
|
push:
|
|
|
|
branches:
|
2022-01-18 14:57:27 +01:00
|
|
|
- 'master'
|
2020-11-19 10:40:39 +01:00
|
|
|
tags:
|
|
|
|
- v*
|
|
|
|
|
2022-08-17 02:17:37 +02:00
|
|
|
env:
|
|
|
|
BUILDX_VERSION: latest
|
|
|
|
BUILDKIT_IMAGE: moby/buildkit:buildx-stable-1
|
|
|
|
|
2020-11-19 10:40:39 +01:00
|
|
|
jobs:
|
|
|
|
docker:
|
|
|
|
runs-on: ubuntu-latest
|
2020-11-19 23:56:09 +01:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
-
|
|
|
|
registry: ''
|
|
|
|
slug: ghactionstest/ghactionstest
|
|
|
|
username_secret: DOCKERHUB_USERNAME
|
|
|
|
password_secret: DOCKERHUB_TOKEN
|
|
|
|
-
|
|
|
|
registry: ghcr.io
|
|
|
|
slug: ghcr.io/docker-ghactiontest/test
|
|
|
|
username_secret: GHCR_USERNAME
|
|
|
|
password_secret: GHCR_PAT
|
|
|
|
-
|
|
|
|
registry: registry.gitlab.com
|
|
|
|
slug: registry.gitlab.com/test1716/test
|
|
|
|
username_secret: GITLAB_USERNAME
|
|
|
|
password_secret: GITLAB_TOKEN
|
2020-12-17 12:06:34 +01:00
|
|
|
-
|
|
|
|
registry: 175142243308.dkr.ecr.us-east-2.amazonaws.com
|
|
|
|
slug: 175142243308.dkr.ecr.us-east-2.amazonaws.com/sandbox/test-docker-action
|
|
|
|
username_secret: AWS_ACCESS_KEY_ID
|
|
|
|
password_secret: AWS_SECRET_ACCESS_KEY
|
|
|
|
-
|
|
|
|
registry: public.ecr.aws
|
2020-12-17 14:56:10 +01:00
|
|
|
slug: public.ecr.aws/q3b5f1u4/test-docker-action
|
2020-12-17 12:06:34 +01:00
|
|
|
username_secret: AWS_ACCESS_KEY_ID
|
|
|
|
password_secret: AWS_SECRET_ACCESS_KEY
|
2020-12-22 17:42:19 +01:00
|
|
|
-
|
|
|
|
registry: us-east4-docker.pkg.dev
|
|
|
|
slug: us-east4-docker.pkg.dev/sandbox-298914/docker-official-github-actions/test-docker-action
|
|
|
|
username_secret: GAR_USERNAME
|
|
|
|
password_secret: GAR_JSON_KEY
|
2020-12-22 11:21:32 +01:00
|
|
|
-
|
|
|
|
registry: gcr.io
|
|
|
|
slug: gcr.io/sandbox-298914/test-docker-action
|
|
|
|
username_secret: GCR_USERNAME
|
|
|
|
password_secret: GCR_JSON_KEY
|
2022-01-27 11:38:06 +01:00
|
|
|
-
|
|
|
|
registry: officialgithubactions.azurecr.io
|
|
|
|
slug: officialgithubactions.azurecr.io/test-docker-action
|
|
|
|
username_secret: AZURE_CLIENT_ID
|
|
|
|
password_secret: AZURE_CLIENT_SECRET
|
2020-11-19 10:40:39 +01:00
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2022-03-02 11:03:44 +00:00
|
|
|
uses: actions/checkout@v3
|
2020-11-19 10:40:39 +01:00
|
|
|
-
|
|
|
|
name: Docker meta
|
2021-03-29 14:33:52 +02:00
|
|
|
id: meta
|
2022-05-05 11:02:33 +00:00
|
|
|
uses: docker/metadata-action@v4
|
2020-11-19 10:40:39 +01:00
|
|
|
with:
|
|
|
|
images: ${{ matrix.slug }}
|
|
|
|
-
|
|
|
|
name: Set up QEMU
|
2022-05-05 19:24:32 +02:00
|
|
|
uses: docker/setup-qemu-action@v2
|
2020-11-19 10:40:39 +01:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2022-05-05 19:24:32 +02:00
|
|
|
uses: docker/setup-buildx-action@v2
|
2022-08-12 16:45:35 +02:00
|
|
|
with:
|
2022-08-17 02:17:37 +02:00
|
|
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
2023-02-08 12:27:02 +00:00
|
|
|
buildkitd-flags: --debug
|
2022-08-12 16:45:35 +02:00
|
|
|
driver-opts: |
|
2022-08-17 02:17:37 +02:00
|
|
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
2020-11-19 10:40:39 +01:00
|
|
|
-
|
|
|
|
name: Login to Registry
|
|
|
|
if: github.event_name != 'pull_request'
|
2022-05-05 19:24:32 +02:00
|
|
|
uses: docker/login-action@v2
|
2020-11-19 10:40:39 +01:00
|
|
|
with:
|
|
|
|
registry: ${{ matrix.registry }}
|
|
|
|
username: ${{ secrets[matrix.username_secret] }}
|
|
|
|
password: ${{ secrets[matrix.password_secret] }}
|
|
|
|
-
|
|
|
|
name: Build and push
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
2021-03-28 16:43:51 +02:00
|
|
|
file: ./test/multi.Dockerfile
|
2020-11-19 10:40:39 +01:00
|
|
|
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
|
|
|
|
push: ${{ github.event_name != 'pull_request' }}
|
2021-03-29 14:33:52 +02:00
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
2020-12-17 14:56:10 +01:00
|
|
|
cache-from: type=registry,ref=${{ matrix.slug }}:master
|
|
|
|
cache-to: type=inline
|
2020-11-19 10:40:39 +01:00
|
|
|
-
|
|
|
|
name: Inspect image
|
|
|
|
if: github.event_name != 'pull_request'
|
|
|
|
run: |
|
2021-03-29 14:33:52 +02:00
|
|
|
docker pull ${{ matrix.slug }}:${{ steps.meta.outputs.version }}
|
|
|
|
docker image inspect ${{ matrix.slug }}:${{ steps.meta.outputs.version }}
|
2020-11-19 10:40:39 +01:00
|
|
|
-
|
|
|
|
name: Check manifest
|
|
|
|
if: github.event_name != 'pull_request'
|
|
|
|
run: |
|
2023-01-11 14:03:02 +01:00
|
|
|
docker buildx imagetools inspect ${{ matrix.slug }}:${{ steps.meta.outputs.version }} --format '{{json .}}'
|