Build CI on Schedule #47
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: Build CI on Schedule | |
"on": | |
schedule: | |
- cron: '0 2 * * 1,4' | |
env: | |
REGISTRY: quay.io | |
REGISTRY_USER: scottharwell | |
IMAGE_NAME: cloud-ee | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
images: | | |
${{ env.REGISTRY }}/${{ env.REGISTRY_USER }}/${{ env.IMAGE_NAME }} | |
tags: | | |
latest | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Log into Red Hat registry | |
uses: docker/login-action@v1 | |
with: | |
registry: registry.redhat.io | |
username: ${{ secrets.RH_REG_USERNAME }} | |
password: ${{ secrets.RH_REG_PASSWORD }} | |
- name: Log into publish registry -- ${{ env.REGISTRY }} | |
uses: docker/login-action@v1 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_PASSWORD }} | |
- name: Install ansible-builder | |
run: pip3 install ansible-builder>=3.0.0 | |
- name: Create the Containerfile file | |
run: ansible-builder create --output-filename Dockerfile | |
- name: Ensure that FROM pulls the amd64 image since there is no arm64 upstream image | |
run: sed -i 's/FROM /FROM --platform=linux\/amd64 /g' context/Dockerfile | |
- name: Build Multiarch Containers | |
id: dockerbuild | |
uses: docker/build-push-action@v2 | |
with: | |
context: context/. | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build-args: | | |
ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_TOKEN=${{ secrets.ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_TOKEN }} |