-
Notifications
You must be signed in to change notification settings - Fork 36
89 lines (80 loc) · 2.74 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Commit
on:
push:
branches:
- master
jobs:
container:
name: Container image
runs-on: ubuntu-latest
strategy:
matrix:
image:
- black
- isort
- kubeval
- kubeconform
- poetry
- pre-commit
- sourcery
- tox
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
definition:
- '${{ matrix.image }}/**'
- id: metadata
name: Extract metadata
if: ${{ steps.filter.outputs.definition == 'true' }}
working-directory: ${{ matrix.image }}
run: |
export VERSION=$(grep -oP "^ENV\sversion\=(.*)" Dockerfile | cut -d "=" -f 2)
echo "::set-output name=version::$VERSION"
- name: Building ${{ matrix.image }} version ${{ steps.metadata.outputs.version }}
if: ${{ steps.filter.outputs.definition == 'true' }}
run: echo kiwicom/${{ matrix.image }}:${{ steps.metadata.outputs.version }}
- name: GitHub Package Registry
if: ${{ steps.filter.outputs.definition == 'true' }}
uses: aevea/action-kaniko@master
with:
registry: ghcr.io
password: ${{ secrets.GITHUB_TOKEN }}
image: ${{ matrix.image }}
cache: true
cache_registry: cache
tag: ${{ steps.metadata.outputs.version }}
tag_with_latest: true
extra_args: >
--context ${{ matrix.image }}
--dockerfile ${{ matrix.image }}/Dockerfile
- name: Dockerhub
if: ${{ steps.filter.outputs.definition == 'true' }}
uses: aevea/action-kaniko@master
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
image: kiwicom/${{ matrix.image }}
cache: true
cache_registry: kiwicom/cache
tag: ${{ steps.metadata.outputs.version }}
tag_with_latest: true
extra_args: >
--context ${{ matrix.image }}
--dockerfile ${{ matrix.image }}/Dockerfile
- name: Create Release
id: create_release
if: ${{ steps.filter.outputs.definition == 'true' }}
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ matrix.image }}-${{ steps.metadata.outputs.version }}
release_name: kiwicom/${{ matrix.image }}:${{ steps.metadata.outputs.version }}
body: |
* [dockerhub](https://hub.docker.com/r/kiwicom/${{ matrix.image }}/tags)
* [github](https://github.com/kiwicom/dockerfiles/packages)
draft: false
prerelease: false