Skip to content

Commit

Permalink
v2 (#50)
Browse files Browse the repository at this point in the history
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
  • Loading branch information
crazy-max and crazy-max committed Mar 29, 2021
1 parent 9be43f0 commit 2f83320
Show file tree
Hide file tree
Showing 15 changed files with 3,001 additions and 513 deletions.
103 changes: 76 additions & 27 deletions .github/workflows/ci.yml
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -76,18 +89,48 @@ 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
uses: actions/checkout@v2
-
name: Docker meta
uses: ./
with:
images: |
${{ env.DOCKER_IMAGE }}
ghcr.io/name/app
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 }}
flavor:
runs-on: ubuntu-latest
steps:
-
name: Checkout
Expand All @@ -99,13 +142,11 @@ jobs:
images: |
${{ env.DOCKER_IMAGE }}
ghcr.io/name/app
tag-semver: |
{{raw}}
{{version}}
{{major}}.{{minor}}.{{patch}}
tag-latest: ${{ matrix.tag-latest }}
flavor: |
prefix=foo-
suffix=-bar
label-custom:
labels:
runs-on: ubuntu-latest
steps:
-
Expand All @@ -118,7 +159,7 @@ jobs:
images: |
${{ env.DOCKER_IMAGE }}
ghcr.io/name/app
label-custom: |
labels: |
maintainer=CrazyMax
org.opencontainers.image.title=MyCustomTitle
org.opencontainers.image.description=Another description
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/test.yml
Expand Up @@ -10,6 +10,7 @@ on:
pull_request:
branches:
- 'master'
- 'releases/v*'
paths-ignore:
- '**.md'

Expand All @@ -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 changes: 0 additions & 25 deletions .github/workflows/validate.yml

This file was deleted.

0 comments on commit 2f83320

Please sign in to comment.