Build and deploy Bay AWX Execution Environment #13
Workflow file for this run
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-deploy-bay-awx-ee | |
run-name: Build and deploy Bay AWX Execution Environment | |
on: | |
pull_request: | |
types: | |
- closed | |
- opened | |
- synchronize | |
schedule: | |
- cron: '23 20 * * 0' | |
workflow_dispatch: | |
env: | |
REGISTRY: ghcr.io | |
jobs: | |
buildx: | |
if: github.event.pull_request.merged == true || contains(fromJson('["schedule", "workflow_dispatch"]'), github.event_name) || github.event_name == 'pull_request' && startsWith(github.head_ref,'build/') | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./images/awx-ee | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- uses: actions/checkout@v3 | |
- name: Login to registry ${{ env.REGISTRY }} | |
uses: docker/[email protected] | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ secrets.REGISTRY_USER }} | |
password: ${{ secrets.REGISTRY_TOKEN }} | |
- name: Extract Docker metadata | |
id: meta | |
uses: docker/[email protected] | |
with: | |
images: | | |
${{ env.REGISTRY }}/${{ github.repository }}/awx-ee | |
tags: | | |
type=ref,event=pr,enable=${{ github.event.pull_request.merged == false }} | |
type=raw,value=${{ github.event.pull_request.base.ref }},enable=${{ github.event.pull_request.merged == true }} | |
type=ref,event=branch,enable=${{ contains(fromJson('["schedule", "workflow_dispatch"]'), github.event_name) }} | |
labels: | | |
maintainer=Digital Transformation | |
repository=${{ github.repositoryUrl }} | |
org.opencontainers.image.authors=Digital Victoria | |
org.opencontainers.image.source=https://github.com/${{ github.repository }}/tree/${{ (contains(fromJson('["opened","synchronize"]'), github.event.action)) && github.head_ref || github.event.action == 'closed' && github.base_ref || github.ref_name }}/images/${{ matrix.images }}/Dockerfile | |
org.opencontainers.image.title=AWX Execution Environment image. | |
org.opencontainers.image.description=AWX Execution Environment image. | |
- name: Build the AWX-EE image | |
run: | | |
pip install --upgrade ansible-builder | |
ansible-builder create \ | |
--output-filename Dockerfile \ | |
--verbosity 3 | |
- name: Push the AWX-EE image | |
uses: docker/bake-action@v4 | |
with: | |
push: true | |
workdir: ./images/awx-ee | |
files: | | |
./docker-bake.hcl | |
${{ steps.meta.outputs.bake-file }} |