-
Notifications
You must be signed in to change notification settings - Fork 0
138 lines (116 loc) Β· 3.88 KB
/
publish.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
---
name: publish
on:
schedule:
- cron: '0 10 * * *' # everyday at 10am
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
GITHUB_EVENT_REPOSITORY_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
GITHUB_EVENT_NUMBER: ${{ github.event.number }}
REGISTRY_URI: ${{ vars.REGISTRY_URI }}
REGISTRY_REPOSITORY: ${{ vars.REGISTRY_REPOSITORY }}
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
IMAGE_NAME: ee-kustomzie-with-ocm-policygenerator-plugin-and-helm
jobs:
build-and-publish-ee:
runs-on: ubuntu-latest
strategy:
fail-fast: false
#matrix:
# platform:
# - linux/amd64
# - linux/arm64
steps:
- name: Checkout ποΈ
uses: actions/checkout@v4
#- name: Prepare
# run: |
# platform=${{ matrix.platform }}
# echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
- name: Docker meta βοΈ
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_URI }}/${{ env.REGISTRY_REPOSITORY }}/${{ env.IMAGE_NAME }}
tags: |
type=schedule,pattern=nightly
type=edge,branch=main
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Image Tags π·
run: echo "${{ steps.meta.outputs.tags }}"
- name: Image Labels π·
run: echo "${{ steps.meta.outputs.labels }}"
- name: Install ansible-builder π§°
run: pip install ansible-builder
- name: Crate Ansible EE container image context π
run: ansible-builder create -v3
- name: Set up QEMU π§°
uses: docker/setup-qemu-action@v3
- name: Build Ansible EE container images π
uses: redhat-actions/buildah-build@v2
with:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
context: ./context
containerfiles: |
./context/Containerfile
platforms: linux/amd64,linux/arm64
#platforms: ${{ matrix.platform }}
# - name: Set up Docker Buildx π§°
# uses: docker/setup-buildx-action@v3
# - name: Login to Container Registry π
# uses: docker/login-action@v3
# with:
# registry: ${{ env.REGISTRY_URI }}
# username: ${{ env.REGISTRY_USERNAME }}
# password: ${{ env.REGISTRY_PASSWORD }}
# - name: Build and push by digest π
# id: build-push
# uses: docker/build-push-action@v6
# with:
# context: ./context
# file: ./context/Containerfile
# platforms: ${{ matrix.platform }}
# labels: ${{ steps.meta.outputs.labels }}
# tags: ${{ steps.meta.outputs.tags }}
# push: true
# load: false
# - name: Pushed Image Digest π
# run: echo ${{ steps.build-push.outputs.digest }}
# - name: Build Ansible EE container images π
# uses: redhat-actions/buildah-build@v2
# with:
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}
# context: ./context
# containerfiles: |
# ./context/Containerfile
# platforms: ${{ matrix.platform }}
- name: Publish images πΊ
id: publish-images
uses: redhat-actions/push-to-registry@v2
with:
tags: ${{ steps.meta.outputs.tags }}
username: ${{ env.REGISTRY_USERNAME }}
password: ${{ env.REGISTRY_PASSWORD }}
- name: Pushed Image Digest π
run: echo ${{ steps.publish-images.outputs.digest }}
- name: Pushed Image Registry Paths π
run: echo ${{ steps.publish-images.outputs.registry-paths }}