update builds to make them a bit more generic

This commit is contained in:
Landon Pierce 2022-06-23 14:31:41 -04:00
Родитель ad7e4b4d05
Коммит 1dc881b5e0
5 изменённых файлов: 44 добавлений и 39 удалений

Просмотреть файл

@ -14,10 +14,10 @@ jobs:
tag_name: ${GITHUB_REF/refs\/tags\//}
# Add webhook jobs below here for each environment you want to automatically update
webhook-dev:
name: Image Build Webhook - Dev
needs: build-image
if: needs.build-image.result == 'success'
uses: Azure/azure-saas/.github/workflows/template-container-image-webhook.yml@main
secrets:
WEBHOOK_URL: ${{ secrets.ASDK_ADMIN_DEV_WEBHOOK_URL }}
# webhook-dev:
# name: Image Build Webhook - Dev
# needs: build-image
# if: needs.build-image.result == 'success'
# uses: Azure/azure-saas/.github/workflows/template-container-image-webhook.yml@main
# secrets:
# WEBHOOK_URL: ${{ secrets.ASDK_ADMIN_DEV_WEBHOOK_URL }}

Просмотреть файл

@ -14,11 +14,10 @@ jobs:
tag_name: ${GITHUB_REF/refs\/tags\//}
# Add webhook jobs below here for each environment you want to automatically update
webhook-dev:
name: Image Build Webhook - Dev
runs-on: ubuntu-latest
needs: build-image
if: needs.build-image.result == 'success'
uses: Azure/azure-saas/.github/workflows/template-container-image-webhook.yml@main
secrets:
WEBHOOK_URL: ${{ secrets.ASDK_WEB_DEV_WEBHOOK_URL }}
# webhook-dev:
# name: Image Build Webhook - Dev
# needs: build-image
# if: needs.build-image.result == 'success'
# uses: Azure/azure-saas/.github/workflows/template-container-image-webhook.yml@main
# secrets:
# WEBHOOK_URL: ${{ secrets.ASDK_WEB_DEV_WEBHOOK_URL }}

Просмотреть файл

@ -14,10 +14,10 @@ jobs:
tag_name: ${GITHUB_REF/refs\/tags\//}
# Add webhook jobs below here for each environment you want to automatically update
webhook-dev:
name: Image Build Webhook - Dev
needs: build-image
if: needs.build-image.result == 'success'
uses: Azure/azure-saas/.github/workflows/template-container-image-webhook.yml@main
secrets:
WEBHOOK_URL: ${{ secrets.ASDK_PERMISSIONS_DEV_WEBHOOK_URL }}
# webhook-dev:
# name: Image Build Webhook - Dev
# needs: build-image
# if: needs.build-image.result == 'success'
# uses: Azure/azure-saas/.github/workflows/template-container-image-webhook.yml@main
# secrets:
# WEBHOOK_URL: ${{ secrets.ASDK_PERMISSIONS_DEV_WEBHOOK_URL }}

Просмотреть файл

@ -14,10 +14,10 @@ jobs:
tag_name: ${GITHUB_REF/refs\/tags\//}
# Add webhook jobs below here for each environment you want to automatically update
webhook-dev:
name: Image Build Webhook - Dev
needs: build-image
if: needs.build-image.result == 'success'
uses: Azure/azure-saas/.github/workflows/template-container-image-webhook.yml@main
secrets:
WEBHOOK_URL: ${{ secrets.ASDK_SIGNUP_DEV_WEBHOOK_URL }}
# webhook-dev:
# name: Image Build Webhook - Dev
# needs: build-image
# if: needs.build-image.result == 'success'
# uses: Azure/azure-saas/.github/workflows/template-container-image-webhook.yml@main
# secrets:
# WEBHOOK_URL: ${{ secrets.ASDK_SIGNUP_DEV_WEBHOOK_URL }}

Просмотреть файл

@ -11,6 +11,11 @@ on:
required: false
type: boolean
default: false
# Change this input if you'd like to publish the containers to a repository other than github packages.
image_repository:
required: false
type: string
default: ghcr.io/${{ github.repository }}
name: Container Image Publishing - Build
@ -22,6 +27,7 @@ jobs:
- name: Code Checkout
uses: actions/checkout@v2
# Replace this login step if you use a container repository other than github packages.
- name: Log in to Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
@ -31,23 +37,23 @@ jobs:
- name: Create Tag
run: |
GH_IMAGE_PATH="ghcr.io/${{ github.repository }}/${{ inputs.image_to_push }}"
GH_TAG=$GH_IMAGE_PATH:${{ inputs.tag_name }}
IMAGE_PATH="${{inputs.image_repository}}/${{ inputs.image_to_push }}"
IMAGE_TAG=$IMAGE_PATH:${{ inputs.tag_name }}
# Make characters lowercase
GH_TAG=$(echo $GH_TAG | tr '[:upper:]' '[:lower:]')
echo "Tagging ${{ inputs.image_to_push }} with $GH_TAG in GitHub Container Registry"
docker tag ${{ inputs.image_to_push }} $GH_TAG
IMAGE_TAG=$(echo $GH_TAG | tr '[:upper:]' '[:lower:]')
echo "Tagging ${{ inputs.image_to_push }} with $IMAGE_TAG in GitHub Container Registry"
docker tag ${{ inputs.image_to_push }} $IMAGE_TAG
- name: Tag Latest
if: ${{ inputs.tag_latest }}
run: |
GH_TAG_LATEST=$GH_IMAGE_PATH:latest
IMAGE_TAG_LATEST=$IMAGE_PATH:latest
# Make characters lowercase
GH_TAG_LATEST=$(echo $GH_TAG_LATEST | tr '[:upper:]' '[:lower:]')
echo "Tagging ${{ inputs.image_to_push }} with $GH_TAG_LATEST in GitHub Container Registry"
docker tag ${{ inputs.image_to_push }} $GH_TAG_LATEST
IMAGE_TAG_LATEST=$(echo $IMAGE_TAG_LATEST | tr '[:upper:]' '[:lower:]')
echo "Tagging ${{ inputs.image_to_push }} with $IMAGE_TAG_LATEST in GitHub Container Registry"
docker tag ${{ inputs.image_to_push }} $IMAGE_TAG_LATEST
- name: Publish Image
run: |
echo "Pushing ${{ inputs.image_to_push }} to GitHub Container Registry"
docker push --all-tags $GH_IMAGE_PATH
docker push --all-tags $IMAGE_PATH