mirror of
https://github.com/docker/build-push-action.git
synced 2024-11-29 19:51:05 -05:00
6b0583b656
Bumps [actions/checkout](https://github.com/actions/checkout) from v2.3.3 to v2.3.4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2.3.3...5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f) Signed-off-by: dependabot[bot] <support@github.com>
71 lines
1.9 KiB
YAML
71 lines
1.9 KiB
YAML
# This workflow is provided just as an usage example and not for repo testing/verification
|
|
name: example
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '0 10 * * 0' # everyday sunday at 10am
|
|
push:
|
|
branches:
|
|
- '**'
|
|
tags:
|
|
- 'v*.*.*'
|
|
pull_request:
|
|
|
|
env:
|
|
DOCKER_IMAGE: localhost:5000/name/app
|
|
|
|
jobs:
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
services:
|
|
registry:
|
|
image: registry:2
|
|
ports:
|
|
- 5000:5000
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v2.3.4
|
|
-
|
|
name: Docker meta
|
|
id: docker_meta
|
|
uses: crazy-max/ghaction-docker-meta@v1
|
|
with:
|
|
images: ${{ env.DOCKER_IMAGE }} # list of Docker images to use as base name for tags
|
|
tag-sha: true # add git short SHA as Docker tag
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
with:
|
|
driver-opts: network=host
|
|
-
|
|
name: Build and export to Docker client
|
|
uses: ./
|
|
with:
|
|
context: ./test
|
|
file: ./test/Dockerfile
|
|
load: true
|
|
tags: ${{ steps.docker_meta.outputs.tags }}
|
|
labels: ${{ steps.docker_meta.outputs.labels }}
|
|
-
|
|
name: Build and push to local registry
|
|
uses: ./
|
|
with:
|
|
context: ./test
|
|
file: ./test/Dockerfile
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
tags: ${{ steps.docker_meta.outputs.tags }}
|
|
labels: ${{ steps.docker_meta.outputs.labels }}
|
|
-
|
|
name: Inspect image
|
|
run: |
|
|
docker image inspect ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }}
|
|
-
|
|
name: Check manifest
|
|
if: github.event_name != 'pull_request'
|
|
run: |
|
|
docker buildx imagetools inspect ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }}
|
|
-
|
|
name: Dump context
|
|
if: always()
|
|
uses: crazy-max/ghaction-dump-context@v1
|