2020-11-19 09:40:39 +00:00
|
|
|
name: e2e
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
schedule:
|
|
|
|
- cron: '0 10 * * *' # everyday at 10am
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
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
|
|
|
|
slug: public.ecr.aws/q3b5f1u4/sandbox/test-docker-action
|
|
|
|
username_secret: AWS_ACCESS_KEY_ID
|
|
|
|
password_secret: AWS_SECRET_ACCESS_KEY
|
2020-11-19 09:40:39 +00:00
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
-
|
|
|
|
name: Docker meta
|
|
|
|
id: docker_meta
|
|
|
|
uses: crazy-max/ghaction-docker-meta@v1
|
|
|
|
with:
|
|
|
|
images: ${{ matrix.slug }}
|
|
|
|
-
|
|
|
|
name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
-
|
|
|
|
name: Login to Registry
|
|
|
|
if: github.event_name != 'pull_request'
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
registry: ${{ matrix.registry }}
|
|
|
|
username: ${{ secrets[matrix.username_secret] }}
|
|
|
|
password: ${{ secrets[matrix.password_secret] }}
|
|
|
|
-
|
|
|
|
name: Build and push
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
context: ./test
|
|
|
|
file: ./test/Dockerfile-multi
|
|
|
|
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
|
|
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
|
|
tags: ${{ steps.docker_meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.docker_meta.outputs.labels }}
|
|
|
|
-
|
|
|
|
name: Inspect image
|
|
|
|
if: github.event_name != 'pull_request'
|
|
|
|
run: |
|
|
|
|
docker pull ${{ matrix.slug }}:${{ steps.docker_meta.outputs.version }}
|
|
|
|
docker image inspect ${{ matrix.slug }}:${{ steps.docker_meta.outputs.version }}
|
|
|
|
-
|
|
|
|
name: Check manifest
|
|
|
|
if: github.event_name != 'pull_request'
|
|
|
|
run: |
|
|
|
|
docker buildx imagetools inspect ${{ matrix.slug }}:${{ steps.docker_meta.outputs.version }}
|
|
|
|
-
|
|
|
|
name: Dump context
|
|
|
|
if: always()
|
|
|
|
uses: crazy-max/ghaction-dump-context@v1
|