-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (94 loc) · 3.02 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
---
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 }}
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}}
- 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: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push by digest
id: build
uses: docker/build-push-action@v6
with:
context: ./context
file: Containerfile
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
push: false
# - 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.prep.outputs.tags }}
# username: ${{ secrets.REGISTRY_USERNAME }}
# password: ${{ secrets.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 }}