mirror of
https://github.com/docker/bake-action.git
synced 2025-12-28 00:41:18 +01:00
109 lines
2.3 KiB
YAML
109 lines
2.3 KiB
YAML
name: ci
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '0 10 * * *' # everyday at 10am
|
|
push:
|
|
branches:
|
|
- 'master'
|
|
- 'releases/v*'
|
|
tags:
|
|
- 'v*'
|
|
pull_request:
|
|
branches:
|
|
- 'master'
|
|
- 'releases/v*'
|
|
|
|
jobs:
|
|
bake:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
target:
|
|
- default
|
|
- release
|
|
services:
|
|
registry:
|
|
image: registry:2
|
|
ports:
|
|
- 5000:5000
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v2
|
|
-
|
|
name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v1
|
|
-
|
|
name: Set up Docker Buildx
|
|
id: buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
with:
|
|
driver-opts: network=host
|
|
-
|
|
name: Build and push
|
|
uses: ./
|
|
with:
|
|
builder: ${{ steps.buildx.outputs.name }}
|
|
files: |
|
|
./test/config.hcl
|
|
targets: |
|
|
${{ matrix.target }}
|
|
push: false # set to true when https://github.com/docker/buildx/issues/179 is fixed
|
|
-
|
|
name: Dump context
|
|
if: always()
|
|
uses: crazy-max/ghaction-dump-context@v1
|
|
|
|
error-msg:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v2
|
|
-
|
|
name: Build
|
|
continue-on-error: true
|
|
uses: ./
|
|
with:
|
|
files: |
|
|
./test/config.hcl
|
|
set: |
|
|
*.platform=linux/amd64,linux/ppc64le,linux/s390x
|
|
-
|
|
name: Dump context
|
|
if: always()
|
|
uses: crazy-max/ghaction-dump-context@v1
|
|
|
|
error-check:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v2
|
|
-
|
|
name: Stop docker
|
|
run: |
|
|
sudo systemctl stop docker
|
|
-
|
|
name: Build
|
|
id: bake
|
|
continue-on-error: true
|
|
uses: ./
|
|
with:
|
|
files: |
|
|
./test/config.hcl
|
|
-
|
|
name: Check
|
|
run: |
|
|
echo "${{ toJson(steps.bake) }}"
|
|
if [ "${{ steps.bake.outcome }}" != "failure" ] || [ "${{ steps.bake.conclusion }}" != "success" ]; then
|
|
echo "::error::Should have failed"
|
|
exit 1
|
|
fi
|
|
-
|
|
name: Dump context
|
|
if: always()
|
|
uses: crazy-max/ghaction-dump-context@v1
|