mirror of
https://github.com/docker/metadata-action.git
synced 2025-06-23 19:27:58 +02:00
103
.github/workflows/ci.yml
vendored
103
.github/workflows/ci.yml
vendored
@ -5,10 +5,14 @@ on:
|
||||
- cron: '0 */4 * * *' # every 4 hours
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
- 'master'
|
||||
- 'releases/v*'
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
pull_request:
|
||||
branches:
|
||||
- 'master'
|
||||
- 'releases/v*'
|
||||
|
||||
env:
|
||||
DOCKER_IMAGE: localhost:5000/name/app
|
||||
@ -27,7 +31,12 @@ jobs:
|
||||
images: |
|
||||
${{ env.DOCKER_IMAGE }}
|
||||
ghcr.io/name/app
|
||||
tag-sha: true
|
||||
tags: |
|
||||
type=schedule
|
||||
type=ref,event=branch
|
||||
type=ref,event=tag
|
||||
type=ref,event=pr
|
||||
type=sha
|
||||
|
||||
tag-schedule:
|
||||
runs-on: ubuntu-latest
|
||||
@ -50,8 +59,12 @@ jobs:
|
||||
images: |
|
||||
${{ env.DOCKER_IMAGE }}
|
||||
ghcr.io/name/app
|
||||
tag-sha: true
|
||||
tag-schedule: ${{ matrix.tag-schedule }}
|
||||
tags: |
|
||||
type=schedule,pattern=${{ matrix.tag-schedule }}
|
||||
type=ref,event=branch
|
||||
type=ref,event=tag
|
||||
type=ref,event=pr
|
||||
type=sha
|
||||
|
||||
tag-match:
|
||||
runs-on: ubuntu-latest
|
||||
@ -76,18 +89,23 @@ jobs:
|
||||
images: |
|
||||
${{ env.DOCKER_IMAGE }}
|
||||
ghcr.io/name/app
|
||||
tag-sha: true
|
||||
tag-match: ${{ matrix.tag-match }}
|
||||
tag-match-group: ${{ matrix.tag-match-group }}
|
||||
tags: |
|
||||
type=schedule
|
||||
type=ref,event=branch
|
||||
type=ref,event=tag
|
||||
type=ref,event=pr
|
||||
type=match,"pattern=${{ matrix.tag-match }}",group=${{ matrix.tag-match-group }}
|
||||
type=sha
|
||||
|
||||
tag-semver:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
tag-latest:
|
||||
- 'true'
|
||||
- 'false'
|
||||
flavor-latest:
|
||||
- "auto"
|
||||
- "true"
|
||||
- "false"
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
@ -99,13 +117,19 @@ jobs:
|
||||
images: |
|
||||
${{ env.DOCKER_IMAGE }}
|
||||
ghcr.io/name/app
|
||||
tag-semver: |
|
||||
{{raw}}
|
||||
{{version}}
|
||||
{{major}}.{{minor}}.{{patch}}
|
||||
tag-latest: ${{ matrix.tag-latest }}
|
||||
tags: |
|
||||
type=schedule
|
||||
type=ref,event=branch
|
||||
type=ref,event=tag
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{raw}}
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}.{{patch}}
|
||||
type=sha
|
||||
flavor: |
|
||||
latest=${{ matrix.flavor-latest }}
|
||||
|
||||
label-custom:
|
||||
flavor:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
@ -118,7 +142,24 @@ jobs:
|
||||
images: |
|
||||
${{ env.DOCKER_IMAGE }}
|
||||
ghcr.io/name/app
|
||||
label-custom: |
|
||||
flavor: |
|
||||
prefix=foo-
|
||||
suffix=-bar
|
||||
|
||||
labels:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
-
|
||||
name: Docker meta
|
||||
uses: ./
|
||||
with:
|
||||
images: |
|
||||
${{ env.DOCKER_IMAGE }}
|
||||
ghcr.io/name/app
|
||||
labels: |
|
||||
maintainer=CrazyMax
|
||||
org.opencontainers.image.title=MyCustomTitle
|
||||
org.opencontainers.image.description=Another description
|
||||
@ -141,11 +182,15 @@ jobs:
|
||||
uses: ./
|
||||
with:
|
||||
images: ${{ env.DOCKER_IMAGE }}
|
||||
tag-sha: true
|
||||
tag-semver: |
|
||||
v{{version}}
|
||||
v{{major}}.{{minor}}
|
||||
v{{major}}
|
||||
tags: |
|
||||
type=schedule
|
||||
type=ref,event=branch
|
||||
type=ref,event=tag
|
||||
type=ref,event=pr
|
||||
type=semver,pattern=v{{version}}
|
||||
type=semver,pattern=v{{major}}.{{minor}}
|
||||
type=semver,pattern=v{{major}}
|
||||
type=sha
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
@ -192,11 +237,15 @@ jobs:
|
||||
images: |
|
||||
${{ env.DOCKER_IMAGE }}
|
||||
ghcr.io/name/app
|
||||
tag-sha: true
|
||||
tag-semver: |
|
||||
{{version}}
|
||||
{{major}}.{{minor}}
|
||||
{{major}}
|
||||
tags: |
|
||||
type=schedule
|
||||
type=ref,event=branch
|
||||
type=ref,event=tag
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=sha
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
|
11
.github/workflows/test.yml
vendored
11
.github/workflows/test.yml
vendored
@ -10,6 +10,7 @@ on:
|
||||
pull_request:
|
||||
branches:
|
||||
- 'master'
|
||||
- 'releases/v*'
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
|
||||
@ -20,12 +21,18 @@ jobs:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
-
|
||||
name: Validate
|
||||
uses: docker/bake-action@v1
|
||||
with:
|
||||
targets: validate
|
||||
-
|
||||
name: Test
|
||||
run: docker buildx bake test
|
||||
uses: docker/bake-action@v1
|
||||
with:
|
||||
targets: test
|
||||
-
|
||||
name: Upload coverage
|
||||
uses: codecov/codecov-action@v1
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
file: ./coverage/clover.xml
|
||||
|
25
.github/workflows/validate.yml
vendored
25
.github/workflows/validate.yml
vendored
@ -1,25 +0,0 @@
|
||||
name: validate
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
- 'releases/v*'
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
pull_request:
|
||||
branches:
|
||||
- 'master'
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
|
||||
jobs:
|
||||
validate:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
-
|
||||
name: Validate
|
||||
run: docker buildx bake validate
|
Reference in New Issue
Block a user