Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Commit

Permalink
tweaks to workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
binhex committed Sep 27, 2021
1 parent a8f362c commit 3a04efe
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/workflow-docker-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ jobs:
- name: Generate temporary tag name
shell: bash
run: |
date_time=$(date +%Y%m%d%H%M%S)
echo "[debug] Generated test tag name is '${date_time}'"
echo "::set-output name=date_time::$date_time"
test_tag=$(date +%Y%m%d%H%M%S)
echo "[debug] Generated test tag name is '${test_tag}'"
echo "::set-output name=test_tag::$test_tag"
id: generate_temporary_tag_name
- name: Build Docker image and tag
uses: nick-invision/retry@v2.4.0
Expand All @@ -47,9 +47,9 @@ jobs:
retry_wait_seconds: 120
command: |
docker build \
--tag ${{ github.repository }}:${{ steps.generate_temporary_tag_name.outputs.date_time }} \
--tag ${{ github.repository }}:${{ steps.generate_temporary_tag_name.outputs.test_tag }} \
--tag ${{ github.repository }}:${{ github.event.inputs.tags }} \
--tag ghcr.io/${{ github.repository }}:${{ steps.generate_temporary_tag_name.outputs.date_time }} \
--tag ghcr.io/${{ github.repository }}:${{ steps.generate_temporary_tag_name.outputs.test_tag }} \
--tag ghcr.io/${{ github.repository }}:${{ github.event.inputs.tags }} \
.
- name: Run Tests
Expand All @@ -59,7 +59,7 @@ jobs:
git_clone_scripts_repo="https://github.com/binhex/scripts.git"
git clone "${git_clone_scripts_repo}" "${git_clone_scripts_dest}"
"${git_clone_scripts_dest}/shell/arch/docker/testrunner.sh" --image-name "ghcr.io/${{ github.repository }}:${{ steps.generate_temporary_tag_name.outputs.date_time }}" --container-ports '-p 9999:8000' --network-type 'bridge' --protocol 'https'
"${git_clone_scripts_dest}/shell/arch/docker/testrunner.sh" --image-name "ghcr.io/${{ github.repository }}:${{ steps.generate_temporary_tag_name.outputs.test_tag }}" --container-ports '-p 9999:8000' --network-type 'bridge' --protocol 'https'
- name: Push Docker image to Docker Hub
uses: nick-invision/retry@v2.4.0
with:
Expand Down
25 changes: 16 additions & 9 deletions .github/workflows/workflow-docker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
retry_wait_seconds: 120
command: |
export
- name: Identify GitHub tag name
- name: Identify GitHub Release tag name
# get tag name from runners environment 'GITHUB_REF' and then use bash substring
# to strip out '+' symbol - required due to gcr not supporting this as a tag
# name (docker hub does support it).
Expand All @@ -49,7 +49,14 @@ jobs:
retry_wait_seconds: 120
command: |
echo "##[set-output name=tag;]$(tag_name=${GITHUB_REF#refs/tags/} && echo "${tag_name//+/-}")"
id: identify_tag
id: identify_github_release_tag_name
- name: Generate temporary tag name
shell: bash
run: |
test_tag=$(date +%Y%m%d%H%M%S)
echo "[debug] Generated test tag name is '${test_tag}'"
echo "::set-output name=test_tag::$test_tag"
id: generate_temporary_tag_name
- name: Build Docker image and tag
uses: nick-invision/retry@v2.4.0
with:
Expand All @@ -58,12 +65,12 @@ jobs:
retry_wait_seconds: 120
command: |
docker build \
--tag ${{ github.repository }}:build \
--tag ${{ github.repository }}:${{ steps.generate_temporary_tag_name.outputs.test_tag }} \
--tag ${{ github.repository }}:latest \
--tag ${{ github.repository }}:${{ steps.identify_tag.outputs.tag }} \
--tag ghcr.io/${{ github.repository }}:build \
--tag ${{ 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_tag.outputs.tag }} \
--tag ghcr.io/${{ github.repository }}:${{ steps.identify_github_release_tag_name.outputs.tag }} \
.
- name: DEBUG Show built Docker Images
uses: nick-invision/retry@v2.4.0
Expand All @@ -80,7 +87,7 @@ jobs:
git_clone_scripts_repo="https://github.com/binhex/scripts.git"
git clone "${git_clone_scripts_repo}" "${git_clone_scripts_dest}"
"${git_clone_scripts_dest}/shell/arch/docker/testrunner.sh" --image-name "ghcr.io/${{ github.repository }}:build" --container-ports '-p 9999:8000' --network-type 'bridge' --protocol 'https'
"${git_clone_scripts_dest}/shell/arch/docker/testrunner.sh" --image-name "ghcr.io/${{ github.repository }}:${{ steps.generate_temporary_tag_name.outputs.test_tag }}" --container-ports '-p 9999:8000' --network-type 'bridge' --protocol 'https'
- name: Push Docker image to Docker Hub
uses: nick-invision/retry@v2.4.0
with:
Expand All @@ -89,7 +96,7 @@ jobs:
retry_wait_seconds: 120
command: |
docker push ${{ github.repository }}:latest
docker push ${{ github.repository }}:${{ steps.identify_tag.outputs.tag }}
docker push ${{ github.repository }}:${{ steps.identify_github_release_tag_name.outputs.tag }}
- name: Push Docker image to GitHub Container Registry (GHCR)
uses: nick-invision/retry@v2.4.0
with:
Expand All @@ -98,4 +105,4 @@ jobs:
retry_wait_seconds: 120
command: |
docker push ghcr.io/${{ github.repository }}:latest
docker push ghcr.io/${{ github.repository }}:${{ steps.identify_tag.outputs.tag }}
docker push ghcr.io/${{ github.repository }}:${{ steps.identify_github_release_tag_name.outputs.tag }}

0 comments on commit 3a04efe

Please sign in to comment.