mirror of
https://github.com/ansible-collections/community.docker.git
synced 2025-12-16 03:52:05 +00:00
Publish test images under another tag to work around strange behavior of Compose's pull policy. (#901)
This commit is contained in:
parent
d334c2362f
commit
37c639f6e8
23
.github/workflows/docker-images.yml
vendored
23
.github/workflows/docker-images.yml
vendored
@ -34,9 +34,11 @@ jobs:
|
||||
matrix:
|
||||
include:
|
||||
- name: simple-1
|
||||
tag: latest
|
||||
tag: tag
|
||||
tag-as-latest: true
|
||||
- name: simple-2
|
||||
tag: latest
|
||||
tag: tag
|
||||
tag-as-latest: true
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
@ -56,7 +58,12 @@ jobs:
|
||||
./build.sh "${CONTAINER_REGISTRY}/${{ matrix.name }}:${{ matrix.tag }}"
|
||||
working-directory: tests/images/${{ matrix.name }}
|
||||
|
||||
- name: Publish container image as ${{ env.CONTAINER_REGISTRY }}/${{ matrix.name }}:latest
|
||||
- name: Tag image as latest
|
||||
if: matrix.tag-as-latest && matrix.tag != 'latest'
|
||||
run: |
|
||||
podman tag "${CONTAINER_REGISTRY}/${{ matrix.name }}:${{ matrix.tag }}" "${CONTAINER_REGISTRY}/${{ matrix.name }}:latest"
|
||||
|
||||
- name: Publish container image ${{ env.CONTAINER_REGISTRY }}/${{ matrix.name }}:${{ matrix.tag }}
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: redhat-actions/push-to-registry@v2
|
||||
with:
|
||||
@ -65,3 +72,13 @@ jobs:
|
||||
tags: ${{ matrix.tag }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Publish container image ${{ env.CONTAINER_REGISTRY }}/${{ matrix.name }}:latest
|
||||
if: github.event_name != 'pull_request' && matrix.tag-as-latest && matrix.tag != 'latest'
|
||||
uses: redhat-actions/push-to-registry@v2
|
||||
with:
|
||||
registry: ${{ env.CONTAINER_REGISTRY }}
|
||||
image: ${{ matrix.name }}
|
||||
tags: latest
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user