Skip to content

Commit

Permalink
Update devel_images.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRealHaoLiu committed Feb 19, 2024
1 parent 0a44289 commit 11e248c
Showing 1 changed file with 11 additions and 49 deletions.
60 changes: 11 additions & 49 deletions .github/workflows/devel_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,55 +17,23 @@ jobs:
contents: read
strategy:
matrix:
platforms: [linux/amd64, linux/arm64]
build-targets:
- image-name: awx_devel
make-target: docker-compose-buildx
- image-name: awx_kube_devel
make-target: awx-kube-dev-buildx
- image-name: awx
make-target: awx-kube-buildx
steps:
- uses: actions/checkout@v3

- name: Get python version from Makefile
run: echo py_version=`make PYTHON_VERSION` >> $GITHUB_ENV

- name: Set lower case owner name
run: |
echo "DEV_DOCKER_TAG_BASE=ghcr.io/${OWNER,,}" >> $GITHUB_ENV
echo "COMPOSE_TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV
env:
OWNER: '${{ github.repository_owner }}'

- name: Install python ${{ env.py_version }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.py_version }}

- name: Log in to registry
- name: Skipping build of awx image for non-awx repository
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
if [[ "${{ matrix.build-targets.image-name }}" == "awx" ]]; then
if ! [[ "${{ github.repository }}" == */awx ]] ; then
echo "Skipping build of awx image for non-awx repository"
exit 0
fi
fi
- name: Pre-pull image to warm build cache
run: |
docker pull --platform ${{ matrix.platforms }} ${DEV_DOCKER_TAG_BASE}/${{ matrix.build-targets.image-name }}:${COMPOSE_TAG} || :
- name: Build and push AWX development environment images
run: |
make ${{ matrix.build-targets.make-target }}
env:
PLATFORMS: ${{ matrix.platforms }}

push-awx-image:
if: endsWith(github.repository, '/awx')
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
packages: write
contents: read
strategy:
matrix:
platforms: [linux/amd64, linux/arm64]
steps:
- uses: actions/checkout@v3

- name: Get python version from Makefile
Expand All @@ -87,12 +55,6 @@ jobs:
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Pre-pull image to warm build cache
run: |
docker pull --platform ${{ matrix.platforms }} ${DEV_DOCKER_TAG_BASE}/awx:${COMPOSE_TAG} || :
- name: Build and push AWX images
- name: Build and push AWX development environment images
run: |
make awx-kube-buildx
env:
PLATFORMS: ${{ matrix.platforms }}
make ${{ matrix.build-targets.make-target }}

0 comments on commit 11e248c

Please sign in to comment.