|
|
@ -11,6 +11,10 @@ jobs:
|
|
|
|
steps:
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Set up QEMU for multi-arch support
|
|
|
|
|
|
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Docker Hub
|
|
|
|
- name: Login to Docker Hub
|
|
|
|
uses: docker/login-action@v2
|
|
|
|
uses: docker/login-action@v2
|
|
|
|
with:
|
|
|
|
with:
|
|
|
@ -76,77 +80,26 @@ jobs:
|
|
|
|
echo "[debug] Generated app name is '${app_name}'"
|
|
|
|
echo "[debug] Generated app name is '${app_name}'"
|
|
|
|
echo "app_name=$app_name" >> $GITHUB_OUTPUT
|
|
|
|
echo "app_name=$app_name" >> $GITHUB_OUTPUT
|
|
|
|
id: generate_app_name
|
|
|
|
id: generate_app_name
|
|
|
|
- name: Build Docker image and tag
|
|
|
|
- name: Build amd64 image and export to Docker for testing
|
|
|
|
uses: nick-fields/retry@v2
|
|
|
|
uses: docker/build-push-action@v5
|
|
|
|
with:
|
|
|
|
|
|
|
|
timeout_minutes: 60
|
|
|
|
|
|
|
|
max_attempts: 3
|
|
|
|
|
|
|
|
retry_wait_seconds: 120
|
|
|
|
|
|
|
|
command: |
|
|
|
|
|
|
|
|
docker build \
|
|
|
|
|
|
|
|
--tag ${{ github.repository }}:${{ steps.generate_temporary_tag_name.outputs.test_tag }} \
|
|
|
|
|
|
|
|
--tag ${{ github.repository }}:latest \
|
|
|
|
|
|
|
|
--tag ${{ github.repository }}:${{ steps.identify_github_release_tag_name.outputs.tag }} \
|
|
|
|
|
|
|
|
--tag quay.io/${{ github.repository }}:${{ steps.generate_temporary_tag_name.outputs.test_tag }} \
|
|
|
|
|
|
|
|
--tag quay.io/${{ github.repository }}:latest \
|
|
|
|
|
|
|
|
--tag quay.io/${{ github.repository }}:${{ steps.identify_github_release_tag_name.outputs.tag }} \
|
|
|
|
|
|
|
|
--tag ghcr.io/${{ github.repository }}:${{ steps.generate_temporary_tag_name.outputs.test_tag }} \
|
|
|
|
|
|
|
|
--tag ghcr.io/${{ github.repository }}:latest \
|
|
|
|
|
|
|
|
--tag ghcr.io/${{ github.repository }}:${{ steps.identify_github_release_tag_name.outputs.tag }} \
|
|
|
|
|
|
|
|
--tag registry.gitlab.com/${{ github.repository }}:${{ steps.generate_temporary_tag_name.outputs.test_tag }} \
|
|
|
|
|
|
|
|
--tag registry.gitlab.com/${{ github.repository }}:latest \
|
|
|
|
|
|
|
|
--tag registry.gitlab.com/${{ github.repository }}:${{ steps.identify_github_release_tag_name.outputs.tag }} \
|
|
|
|
|
|
|
|
--build-arg release_tag_name=${{ steps.identify_github_release_tag_name.outputs.tag }} \
|
|
|
|
|
|
|
|
.
|
|
|
|
|
|
|
|
- name: DEBUG Show built Docker Images
|
|
|
|
|
|
|
|
uses: nick-fields/retry@v2
|
|
|
|
|
|
|
|
with:
|
|
|
|
with:
|
|
|
|
timeout_minutes: 5
|
|
|
|
context: .
|
|
|
|
max_attempts: 3
|
|
|
|
load: true
|
|
|
|
retry_wait_seconds: 120
|
|
|
|
tags: ${{ steps.generate_temporary_tag_name.outputs.test_tag }}
|
|
|
|
command: |
|
|
|
|
- name: Run tests using previously built image
|
|
|
|
docker images
|
|
|
|
|
|
|
|
- name: Run Tests
|
|
|
|
|
|
|
|
shell: bash
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
run: |
|
|
|
|
git_clone_scripts_dest="/tmp/scripts"
|
|
|
|
git_clone_scripts_dest="/tmp/scripts"
|
|
|
|
git_clone_scripts_repo="https://github.com/binhex/scripts.git"
|
|
|
|
git_clone_scripts_repo="https://github.com/binhex/scripts.git"
|
|
|
|
|
|
|
|
|
|
|
|
git clone "${git_clone_scripts_repo}" "${git_clone_scripts_dest}"
|
|
|
|
git clone "${git_clone_scripts_repo}" "${git_clone_scripts_dest}"
|
|
|
|
"${git_clone_scripts_dest}/shell/arch/docker/testrunner.sh" --app-name ${{ steps.generate_app_name.outputs.app_name }} --image-name "ghcr.io/${{ github.repository }}:${{ steps.generate_temporary_tag_name.outputs.test_tag }}"
|
|
|
|
"${git_clone_scripts_dest}/shell/arch/docker/testrunner.sh" --app-name ${{ steps.generate_app_name.outputs.app_name }} --image-name "ghcr.io/${{ github.repository }}:${{ steps.generate_temporary_tag_name.outputs.test_tag }}"
|
|
|
|
- name: Push Docker image to Docker Hub
|
|
|
|
# note this will re-use the internal cached amd64 image from the previous build
|
|
|
|
uses: nick-fields/retry@v2
|
|
|
|
- name: Build multi-arch Docker image, tag and push to registries
|
|
|
|
with:
|
|
|
|
uses: docker/build-push-action@v5
|
|
|
|
timeout_minutes: 30
|
|
|
|
|
|
|
|
max_attempts: 3
|
|
|
|
|
|
|
|
retry_wait_seconds: 120
|
|
|
|
|
|
|
|
command: |
|
|
|
|
|
|
|
|
docker push ${{ github.repository }}:latest
|
|
|
|
|
|
|
|
docker push ${{ github.repository }}:${{ steps.identify_github_release_tag_name.outputs.tag }}
|
|
|
|
|
|
|
|
- name: Push Docker image to Quay Container Registry
|
|
|
|
|
|
|
|
uses: nick-fields/retry@v2
|
|
|
|
|
|
|
|
with:
|
|
|
|
|
|
|
|
timeout_minutes: 30
|
|
|
|
|
|
|
|
max_attempts: 3
|
|
|
|
|
|
|
|
retry_wait_seconds: 120
|
|
|
|
|
|
|
|
command: |
|
|
|
|
|
|
|
|
docker push quay.io/${{ github.repository }}:latest
|
|
|
|
|
|
|
|
docker push quay.io/${{ github.repository }}:${{ steps.identify_github_release_tag_name.outputs.tag }}
|
|
|
|
|
|
|
|
- name: Push Docker image to GitHub Container Registry (GHCR)
|
|
|
|
|
|
|
|
uses: nick-fields/retry@v2
|
|
|
|
|
|
|
|
with:
|
|
|
|
with:
|
|
|
|
timeout_minutes: 30
|
|
|
|
context: .
|
|
|
|
max_attempts: 3
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
retry_wait_seconds: 120
|
|
|
|
push: true
|
|
|
|
command: |
|
|
|
|
tags: ${{ github.repository }}:latest, ${{ github.repository }}:${{ steps.identify_github_release_tag_name.outputs.tag }}, quay.io/${{ github.repository }}:latest, quay.io/${{ github.repository }}:${{ steps.identify_github_release_tag_name.outputs.tag }}, ghcr.io/${{ github.repository }}:latest, ghcr.io/${{ github.repository }}:${{ steps.identify_github_release_tag_name.outputs.tag }}, registry.gitlab.com/${{ github.repository }}:latest, registry.gitlab.com/${{ github.repository }}:${{ steps.identify_github_release_tag_name.outputs.tag }}
|
|
|
|
docker push ghcr.io/${{ github.repository }}:latest
|
|
|
|
build-args: |
|
|
|
|
docker push ghcr.io/${{ github.repository }}:${{ steps.identify_github_release_tag_name.outputs.tag }}
|
|
|
|
release_tag_name=${{ steps.identify_github_release_tag_name.outputs.tag }}
|
|
|
|
- name: Push Docker image to GitLab Container Registry (GCR)
|
|
|
|
|
|
|
|
uses: nick-fields/retry@v2
|
|
|
|
|
|
|
|
with:
|
|
|
|
|
|
|
|
timeout_minutes: 30
|
|
|
|
|
|
|
|
max_attempts: 3
|
|
|
|
|
|
|
|
retry_wait_seconds: 120
|
|
|
|
|
|
|
|
command: |
|
|
|
|
|
|
|
|
docker push registry.gitlab.com/${{ github.repository }}:latest
|
|
|
|
|
|
|
|
docker push registry.gitlab.com/${{ github.repository }}:${{ steps.identify_github_release_tag_name.outputs.tag }}
|
|
|
|
|
|
|
|