-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #94 from clearlydefined/elr/version-in-docker
add version and sha in docker image instead of Azure configs
- Loading branch information
Showing
4 changed files
with
17 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# This workflow will build a docker image, push it to ghcr.io, and deploy it to an Azure WebApp. | ||
# v2.0.0 - This tag coordinates the other reusable parts of this workflow. | ||
# v3.0.0 - This tag coordinates the other reusable parts of this workflow. | ||
# * app-build-docker-image.yml | ||
# * app-deploy-to-azure.yml | ||
# * app-is-deployable.yml | ||
|
@@ -79,7 +79,7 @@ jobs: | |
uses: actions/[email protected] | ||
with: | ||
repository: 'clearlydefined/operations' | ||
ref: 'v2.0.0' | ||
ref: 'v3.0.0' | ||
path: 'operations' | ||
- name: Get version from package-lock.json | ||
id: get_version | ||
|
@@ -97,20 +97,20 @@ jobs: | |
build-and-publish-image: | ||
name: Build and publish Docker image | ||
needs: get-version | ||
uses: clearlydefined/operations/.github/workflows/app-build-docker-image.yml@v2.0.0 | ||
uses: ./.github/workflows/app-build-docker-image.yml | ||
secrets: | ||
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }} | ||
PRODUCTION_DEPLOYERS: ${{ secrets.PRODUCTION_DEPLOYERS }} | ||
with: | ||
deploy-env: ${{ inputs.deploy-env }} | ||
application-type: ${{ inputs.application-type }} | ||
image-tag: ${{ needs.get-version.outputs.version }} | ||
application-version: ${{ needs.get-version.outputs.version }} | ||
build-args: ${{ inputs.docker-build-args }} | ||
|
||
deploy-primary-app-to-azure: | ||
name: Deploy to primary Azure app | ||
needs: [get-version, build-and-publish-image] | ||
uses: clearlydefined/operations/.github/workflows/app-deploy-to-azure.yml@v2.0.0 | ||
uses: ./.github/workflows/app-deploy-to-azure.yml | ||
secrets: | ||
AZURE_WEBAPP_PUBLISH_PROFILE: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} | ||
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} | ||
|
@@ -119,14 +119,13 @@ jobs: | |
with: | ||
deploy-env: ${{ inputs.deploy-env }} | ||
azure-webapp-name: ${{ inputs.azure-app-base-name }}${{ inputs.azure-app-name-postfix }} | ||
application-version: ${{ needs.get-version.outputs.version }} | ||
image-name-with-tag: ${{ needs.build-and-publish-image.outputs.docker-image-name-with-tag }} | ||
|
||
deploy-secondary-app-to-azure: | ||
name: Deploy to secondary Azure app | ||
if: ${{ inputs.secondary-azure-app-name-postfix != '' }} | ||
needs: [get-version, build-and-publish-image] | ||
uses: clearlydefined/operations/.github/workflows/app-deploy-to-azure.yml@v2.0.0 | ||
uses: ./.github/workflows/app-deploy-to-azure.yml | ||
secrets: | ||
AZURE_WEBAPP_PUBLISH_PROFILE: ${{ secrets.AZURE_SECONDARY_WEBAPP_PUBLISH_PROFILE }} | ||
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} | ||
|
@@ -135,5 +134,4 @@ jobs: | |
with: | ||
deploy-env: ${{ inputs.deploy-env }} | ||
azure-webapp-name: ${{ inputs.azure-app-base-name }}${{ inputs.secondary-azure-app-name-postfix }} | ||
application-version: ${{ needs.get-version.outputs.version }} | ||
image-name-with-tag: ${{ needs.build-and-publish-image.outputs.docker-image-name-with-tag }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ on: | |
description: 'application type (i.e. api | worker | ui) - used as a label for the Docker image' | ||
required: true | ||
type: string | ||
image-tag: | ||
application-version: | ||
description: 'the tag to use for the image (e.g. prod: v1.2.0, dev: v1.2.0+dev:1D3F567890)' | ||
required: true | ||
type: string | ||
|
@@ -35,7 +35,7 @@ on: | |
|
||
jobs: | ||
check-deployable: | ||
uses: clearlydefined/operations/.github/workflows/app-is-deployable.yml@v2.0.0 | ||
uses: ./.github/workflows/app-is-deployable.yml | ||
with: | ||
deploy-env: ${{ inputs.deploy-env }} | ||
secrets: | ||
|
@@ -52,7 +52,7 @@ jobs: | |
uses: actions/[email protected] | ||
with: | ||
repository: 'clearlydefined/operations' | ||
ref: 'v2.0.0' | ||
ref: 'v3.0.0' | ||
path: 'operations' | ||
- name: Determine Docker Image Name | ||
id: determine_image_name | ||
|
@@ -61,7 +61,7 @@ jobs: | |
script_log=$(./operations/scripts/app-workflows/determine-image-name.sh \ | ||
"${{ github.repository }}" \ | ||
"${{ inputs.deploy-env }}" \ | ||
"${{ inputs.image-tag }}") || (echo "$script_log" && exit 1) | ||
"${{ inputs.application-version }}") || (echo "$script_log" && exit 1) | ||
echo -e "---- script log\n$script_log\n----"; \ | ||
image_name=$(echo "$script_log" | tail -n 1) | ||
echo "DOCKER_IMAGE_NAME_WITH_TAG=$image_name" >> $GITHUB_ENV | ||
|
@@ -87,7 +87,10 @@ jobs: | |
context: . | ||
push: true | ||
file: Dockerfile | ||
build-args: ${{ inputs.build-args }} | ||
build-args: | | ||
APP_VERSION=${{ inputs.application-version }} | ||
BUILD_SHA=${{ github.sha }} | ||
${{ inputs.build-args }} | ||
tags: ${{ needs.determine-image-name.outputs.docker-image-name-with-tag }} | ||
labels: | | ||
env=${{ inputs.deploy-env }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ jobs: | |
uses: actions/[email protected] | ||
with: | ||
repository: 'clearlydefined/operations' | ||
ref: 'v2.0.0' | ||
ref: 'v3.0.0' | ||
path: 'operations' | ||
- id: confirm-dev | ||
shell: bash | ||
|
@@ -47,7 +47,7 @@ jobs: | |
uses: actions/[email protected] | ||
with: | ||
repository: 'clearlydefined/operations' | ||
ref: 'v2.0.0' | ||
ref: 'v3.0.0' | ||
path: 'operations' | ||
|
||
- name: Get organization ID | ||
|