Skip to content

wip - new ci 2

wip - new ci 2 #26

Workflow file for this run

---
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 }}