2020-11-19 09:40:39 +00:00
|
|
|
name: e2e
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
2022-08-12 14:45:35 +00: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 09:40:39 +00:00
|
|
|
schedule:
|
2021-11-16 06:19:27 +00:00
|
|
|
- cron: '0 10 * * *'
|
2020-11-19 09:40:39 +00:00
|
|
|
push:
|
|
|
|
branches:
|
2022-01-18 13:57:27 +00:00
|
|
|
- 'master'
|
2020-11-19 09:40:39 +00:00
|
|
|
tags:
|
|
|
|
- v*
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
docker:
|
|
|
|
runs-on: ubuntu-latest
|
2020-11-19 22:56:09 +00: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 11:06:34 +00: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 13:56:10 +00:00
|
|
|
slug: public.ecr.aws/q3b5f1u4/test-docker-action
|
2020-12-17 11:06:34 +00:00
|
|
|
username_secret: AWS_ACCESS_KEY_ID
|
|
|
|
password_secret: AWS_SECRET_ACCESS_KEY
|
2020-12-22 16:42:19 +00: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 10:21:32 +00:00
|
|
|
-
|
|
|
|
registry: gcr.io
|
|
|
|
slug: gcr.io/sandbox-298914/test-docker-action
|
|
|
|
username_secret: GCR_USERNAME
|
|
|
|
password_secret: GCR_JSON_KEY
|
2022-01-27 10:38:06 +00: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 09:40:39 +00:00
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2022-03-02 11:03:44 +00:00
|
|
|
uses: actions/checkout@v3
|
2020-11-19 09:40:39 +00:00
|
|
|
-
|
|
|
|
name: Docker meta
|
2021-03-29 12:33:52 +00:00
|
|
|
id: meta
|
2022-05-05 11:02:33 +00:00
|
|
|
uses: docker/metadata-action@v4
|
2020-11-19 09:40:39 +00:00
|
|
|
with:
|
|
|
|
images: ${{ matrix.slug }}
|
|
|
|
-
|
|
|
|
name: Set up QEMU
|
2022-05-05 17:24:32 +00:00
|
|
|
uses: docker/setup-qemu-action@v2
|
2020-11-19 09:40:39 +00:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2022-05-05 17:24:32 +00:00
|
|
|
uses: docker/setup-buildx-action@v2
|
2022-08-12 14:45:35 +00:00
|
|
|
with:
|
|
|
|
version: ${{ matrix.buildx-version }}
|
|
|
|
driver-opts: |
|
|
|
|
${{ matrix.buildkit-image }}
|
2020-11-19 09:40:39 +00:00
|
|
|
-
|
|
|
|
name: Login to Registry
|
|
|
|
if: github.event_name != 'pull_request'
|
2022-05-05 17:24:32 +00:00
|
|
|
uses: docker/login-action@v2
|
2020-11-19 09:40:39 +00: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 14:43:51 +00:00
|
|
|
file: ./test/multi.Dockerfile
|
2020-11-19 09:40:39 +00: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 12:33:52 +00:00
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
2020-12-17 13:56:10 +00:00
|
|
|
cache-from: type=registry,ref=${{ matrix.slug }}:master
|
|
|
|
cache-to: type=inline
|
2020-11-19 09:40:39 +00:00
|
|
|
-
|
|
|
|
name: Inspect image
|
|
|
|
if: github.event_name != 'pull_request'
|
|
|
|
run: |
|
2021-03-29 12:33:52 +00:00
|
|
|
docker pull ${{ matrix.slug }}:${{ steps.meta.outputs.version }}
|
|
|
|
docker image inspect ${{ matrix.slug }}:${{ steps.meta.outputs.version }}
|
2020-11-19 09:40:39 +00:00
|
|
|
-
|
|
|
|
name: Check manifest
|
|
|
|
if: github.event_name != 'pull_request'
|
|
|
|
run: |
|
2021-03-29 12:33:52 +00:00
|
|
|
docker buildx imagetools inspect ${{ matrix.slug }}:${{ steps.meta.outputs.version }}
|