wip - new ci 2 #29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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-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: Pushed Image Registry Paths π | |
run: echo ${{ steps.build-push.outputs.imageid }} | |
# - 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 }} |