mirror of
https://git.mirrors.martin98.com/https://github.com/docker/setup-docker-action
synced 2025-04-18 12:09:46 +08:00
167 lines
3.4 KiB
YAML
167 lines
3.4 KiB
YAML
name: ci
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '0 10 * * *'
|
|
push:
|
|
branches:
|
|
- 'master'
|
|
- 'releases/v*'
|
|
tags:
|
|
- 'v*'
|
|
pull_request:
|
|
|
|
jobs:
|
|
main:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os:
|
|
- ubuntu-latest
|
|
- macos-latest
|
|
- windows-latest
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v3
|
|
-
|
|
name: Set up Docker
|
|
uses: ./
|
|
with:
|
|
version: v23.0.0
|
|
|
|
channel:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os:
|
|
- ubuntu-latest
|
|
- macos-latest
|
|
- windows-latest
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v3
|
|
-
|
|
name: Set up Docker
|
|
uses: ./
|
|
with:
|
|
version: v23.0.0-rc.4
|
|
channel: test
|
|
|
|
context:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os:
|
|
- ubuntu-latest
|
|
- macos-latest
|
|
- windows-latest
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v3
|
|
-
|
|
name: Set up Docker
|
|
uses: ./
|
|
with:
|
|
version: v23.0.0
|
|
context: foo
|
|
-
|
|
name: Check context
|
|
run: |
|
|
docker context inspect foo
|
|
|
|
build-linux:
|
|
runs-on: ubuntu-latest
|
|
services:
|
|
registry:
|
|
image: registry:2
|
|
ports:
|
|
- 5000:5000
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v3
|
|
-
|
|
name: Set up Docker
|
|
uses: ./
|
|
with:
|
|
version: v23.0.1
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
with:
|
|
driver: docker
|
|
driver-opts: network=host
|
|
-
|
|
name: Build and push
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: ./test
|
|
push: true
|
|
tags: |
|
|
localhost:5000/name/app:latest
|
|
-
|
|
name: Inspect
|
|
run: |
|
|
docker buildx imagetools inspect localhost:5000/name/app:latest --format '{{json .}}'
|
|
|
|
build-macos:
|
|
runs-on: macos-latest
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v3
|
|
-
|
|
name: Set up Docker
|
|
uses: ./
|
|
with:
|
|
version: v23.0.1
|
|
-
|
|
name: Start registry
|
|
run: |
|
|
docker run -d -p 5000:5000 --restart=always --name registry registry:2
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
with:
|
|
driver: docker
|
|
driver-opts: network=host
|
|
-
|
|
name: Build and push
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: ./test
|
|
push: true
|
|
tags: |
|
|
localhost:5000/name/app:latest
|
|
-
|
|
name: Inspect
|
|
run: |
|
|
docker buildx imagetools inspect localhost:5000/name/app:latest --format '{{json .}}'
|
|
|
|
build-windows:
|
|
runs-on: windows-latest
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v3
|
|
-
|
|
name: Set up Docker
|
|
uses: ./
|
|
with:
|
|
version: v23.0.1
|
|
-
|
|
name: Build
|
|
working-directory: ./test
|
|
run: |
|
|
docker build -f win.Dockerfile -t test .
|
|
-
|
|
name: Inspect
|
|
run: |
|
|
docker image inspect test
|