|
| 1 | +name: e2e |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + schedule: |
| 6 | + - cron: '0 10 * * *' # everyday at 10am |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - master |
| 10 | + tags: |
| 11 | + - v* |
| 12 | + |
| 13 | +jobs: |
| 14 | + docker: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + matrix: |
| 17 | + include: |
| 18 | + - |
| 19 | + registry: '' |
| 20 | + slug: ghactionstest/ghactionstest |
| 21 | + username_secret: DOCKERHUB_USERNAME |
| 22 | + password_secret: DOCKERHUB_TOKEN |
| 23 | + - |
| 24 | + registry: ghcr.io |
| 25 | + slug: ghcr.io/docker-ghactiontest/test |
| 26 | + username_secret: GHCR_USERNAME |
| 27 | + password_secret: GHCR_PAT |
| 28 | + - |
| 29 | + registry: registry.gitlab.com |
| 30 | + slug: registry.gitlab.com/test1716/test |
| 31 | + username_secret: GITLAB_USERNAME |
| 32 | + password_secret: GITLAB_TOKEN |
| 33 | + steps: |
| 34 | + - |
| 35 | + name: Checkout |
| 36 | + uses: actions/checkout@v2 |
| 37 | + - |
| 38 | + name: Docker meta |
| 39 | + id: docker_meta |
| 40 | + uses: crazy-max/ghaction-docker-meta@v1 |
| 41 | + with: |
| 42 | + images: ${{ matrix.slug }} |
| 43 | + - |
| 44 | + name: Set up QEMU |
| 45 | + uses: docker/setup-qemu-action@v1 |
| 46 | + - |
| 47 | + name: Set up Docker Buildx |
| 48 | + uses: docker/setup-buildx-action@v1 |
| 49 | + - |
| 50 | + name: Login to Registry |
| 51 | + if: github.event_name != 'pull_request' |
| 52 | + uses: docker/login-action@v1 |
| 53 | + with: |
| 54 | + registry: ${{ matrix.registry }} |
| 55 | + username: ${{ secrets[matrix.username_secret] }} |
| 56 | + password: ${{ secrets[matrix.password_secret] }} |
| 57 | + - |
| 58 | + name: Build and push |
| 59 | + uses: ./ |
| 60 | + with: |
| 61 | + context: ./test |
| 62 | + file: ./test/Dockerfile-multi |
| 63 | + platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x |
| 64 | + push: ${{ github.event_name != 'pull_request' }} |
| 65 | + tags: ${{ steps.docker_meta.outputs.tags }} |
| 66 | + labels: ${{ steps.docker_meta.outputs.labels }} |
| 67 | + - |
| 68 | + name: Inspect image |
| 69 | + if: github.event_name != 'pull_request' |
| 70 | + run: | |
| 71 | + docker pull ${{ matrix.slug }}:${{ steps.docker_meta.outputs.version }} |
| 72 | + docker image inspect ${{ matrix.slug }}:${{ steps.docker_meta.outputs.version }} |
| 73 | + - |
| 74 | + name: Check manifest |
| 75 | + if: github.event_name != 'pull_request' |
| 76 | + run: | |
| 77 | + docker buildx imagetools inspect ${{ matrix.slug }}:${{ steps.docker_meta.outputs.version }} |
| 78 | + - |
| 79 | + name: Dump context |
| 80 | + if: always() |
| 81 | + uses: crazy-max/ghaction-dump-context@v1 |
0 commit comments