Skip to content

Commit

Permalink
WIP - new ci
Browse files Browse the repository at this point in the history
  • Loading branch information
itewk committed Oct 18, 2024
1 parent 00cc9ed commit 00d6916
Showing 1 changed file with 51 additions and 30 deletions.
81 changes: 51 additions & 30 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ on:
branches:
- main
tags:
- 'v*.*.*'
- 'v*'
pull_request:
branches: [ main ]
branches:
- main
workflow_dispatch:

concurrency:
Expand All @@ -22,49 +23,69 @@ env:
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

env:
IMAGE_NAME: ee-kustomzie-with-ocm-policygenerator-plugin-and-helm

outputs:
version: ${{ steps.prep.outputs.version }}
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm64

steps:
- name: Checkout πŸ›ŽοΈ
uses: actions/[email protected]

- name: Determine Image Version and Tags βš™οΈ
id: prep
run: ${GITHUB_WORKSPACE}/.github/scripts/determine-image-version.sh

- name: Version πŸ“Œ
run: echo ${{ steps.prep.outputs.version }}
- 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.prep.outputs.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: Build Ansible EE container image πŸ› 
run: |
ansible-builder build -v3 \
--tag ${{ steps.prep.outputs.tags }}
- name: Publish images πŸ”Ί
id: publish-images
uses: redhat-actions/[email protected]
- name: Crate Ansible EE container image context πŸ› 
run: ansible-builder create -v3

- name: Build Ansible EE container images πŸ› 
uses: redhat-actions/buildah-build@v2
with:
tags: ${{ steps.prep.outputs.tags }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
tags: ${{ steps.meta.outputs.tags }}
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 Digest πŸ”–
# run: echo ${{ steps.publish-images.outputs.digest }}

- name: Pushed Image Registry Paths πŸ”–
run: echo ${{ steps.publish-images.outputs.registry-paths }}
# - name: Pushed Image Registry Paths πŸ”–
# run: echo ${{ steps.publish-images.outputs.registry-paths }}

0 comments on commit 00d6916

Please sign in to comment.