-
Notifications
You must be signed in to change notification settings - Fork 182
101 lines (99 loc) · 3.61 KB
/
containers.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
90
91
92
93
94
95
96
97
98
99
100
101
name: Build container images
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 'Get Previous tag'
id: latest_tag
run: echo "::set-output name=git_latest_tag::$(git describe --tags --abbrev=0)"
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker meta for 'basic' flavour
id: metabasic
uses: docker/metadata-action@v5
with:
images: |
chaostoolkit/chaostoolkit
tags: |
type=raw,value=basic
labels: |
org.opencontainers.image.version=${{steps.latest_tag.outputs.git_latest_tag}}
- name: Docker meta for 'full' flavour
id: metafull
uses: docker/metadata-action@v5
with:
images: |
chaostoolkit/chaostoolkit
tags: |
type=raw,value=full
labels: |
org.opencontainers.image.version=${{steps.latest_tag.outputs.git_latest_tag}}
- name: Docker meta for 'alpine' flavour
id: alpine
uses: docker/metadata-action@v5
with:
images: |
chaostoolkit/chaostoolkit
tags: |
type=raw,value=latest
type=raw,value=${{steps.latest_tag.outputs.git_latest_tag}}
labels: |
org.opencontainers.image.version=${{steps.latest_tag.outputs.git_latest_tag}}
- name: Build and push chaostoolkit-basic
uses: docker/build-push-action@v5
with:
context: ./container
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64,linux/arm64
file: ./container/Dockerfile-basic
tags: ${{ steps.metabasic.outputs.tags }}
labels: ${{ steps.metabasic.outputs.labels }}
build-args: |
CTK_VERSION=${{steps.latest_tag.outputs.git_latest_tag}}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and push chaostoolkit-full
uses: docker/build-push-action@v5
with:
context: ./container
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64,linux/arm64
file: ./container/Dockerfile-full
tags: ${{ steps.metafull.outputs.tags }}
labels: ${{ steps.metafull.outputs.labels }}
build-args: |
CTK_VERSION=${{steps.latest_tag.outputs.git_latest_tag}}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and push chaostoolkit latest
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64,linux/arm64
file: ./Dockerfile
tags: ${{ steps.alpine.outputs.tags }}
labels: ${{ steps.alpine.outputs.labels }}
build-args: |
ctkversion=${{steps.latest_tag.outputs.git_latest_tag}}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Update repo description
uses: peter-evans/dockerhub-description@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKER_PWD }}
repository: chaostoolkit/chaostoolkit
short-description: ${{ github.event.repository.description }}