-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
11 additions
and
11 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 |
---|---|---|
|
@@ -19,35 +19,35 @@ jobs: | |
TAG_NAME="" | ||
fi | ||
BUILD_ARGS="" | ||
if docker pull "ghcr.io/whiletrue-industries/${IMAGE_NAME}:latest"; then | ||
BUILD_ARGS="--cache-from ghcr.io/whiletrue-industries/${IMAGE_NAME}:latest" | ||
if docker pull "ghcr.io/kolzchut/${IMAGE_NAME}:latest"; then | ||
BUILD_ARGS="--cache-from ghcr.io/kolzchut/${IMAGE_NAME}:latest" | ||
fi | ||
docker build -t api $BUILD_ARGS . &&\ | ||
echo "${GITHUB_TOKEN}" | docker login https://ghcr.io -u whiletrue-industries --password-stdin &&\ | ||
docker tag api "ghcr.io/whiletrue-industries/${IMAGE_NAME}:${GITHUB_SHA}" &&\ | ||
docker push "ghcr.io/whiletrue-industries/${IMAGE_NAME}:${GITHUB_SHA}" &&\ | ||
docker tag api "ghcr.io/kolzchut/${IMAGE_NAME}:${GITHUB_SHA}" &&\ | ||
docker push "ghcr.io/kolzchut/${IMAGE_NAME}:${GITHUB_SHA}" &&\ | ||
if [ "${GITHUB_REF}" == "refs/heads/main" ] || [ "${TAG_NAME}" != "" ]; then | ||
echo "${SRM_DEVOPS_DEPLOY_KEY}" > srm_devops_deploy_key &&\ | ||
chmod 400 srm_devops_deploy_key &&\ | ||
export GIT_SSH_COMMAND="ssh -i $(pwd)/srm_devops_deploy_key -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" &&\ | ||
git clone [email protected]:whiletrue-industries/srm-devops.git &&\ | ||
git clone [email protected]:kolzchut/srm-devops.git &&\ | ||
git config --global user.name "srm-devops CI" &&\ | ||
git config --global user.email "srm-devops-ci@localhost" &&\ | ||
cd srm-devops &&\ | ||
VALUES_AUTO_UPDATED_FILE="helm/${CHART_NAME}/values.auto-updated.yaml" &&\ | ||
IMAGE="ghcr.io/whiletrue-industries/${IMAGE_NAME}:${GITHUB_SHA}" &&\ | ||
IMAGE="ghcr.io/kolzchut/${IMAGE_NAME}:${GITHUB_SHA}" &&\ | ||
if [ "${TAG_NAME}" != "" ]; then | ||
VALUES_AUTO_UPDATED_FILE="helm/${CHART_NAME}/values.auto-updated.production.yaml" &&\ | ||
docker tag "${IMAGE}" "ghcr.io/whiletrue-industries/${IMAGE_NAME}:${TAG_NAME}-${GITHUB_SHA}" &&\ | ||
docker push "ghcr.io/whiletrue-industries/${IMAGE_NAME}:${TAG_NAME}-${GITHUB_SHA}" &&\ | ||
IMAGE="ghcr.io/whiletrue-industries/${IMAGE_NAME}:${TAG_NAME}-${GITHUB_SHA}" | ||
docker tag "${IMAGE}" "ghcr.io/kolzchut/${IMAGE_NAME}:${TAG_NAME}-${GITHUB_SHA}" &&\ | ||
docker push "ghcr.io/kolzchut/${IMAGE_NAME}:${TAG_NAME}-${GITHUB_SHA}" &&\ | ||
IMAGE="ghcr.io/kolzchut/${IMAGE_NAME}:${TAG_NAME}-${GITHUB_SHA}" | ||
fi &&\ | ||
bin/update_yaml.py '{"'"${CHART_SUBPART}"'":{"image":"'"${IMAGE}"'"}}' "${VALUES_AUTO_UPDATED_FILE}" &&\ | ||
git add "${VALUES_AUTO_UPDATED_FILE}" &&\ | ||
git commit -m "update ${CHART_SUBPART} image: ${VALUES_AUTO_UPDATED_FILE}" &&\ | ||
git push origin main | ||
fi &&\ | ||
if [ "${GITHUB_REF}" == "refs/heads/main" ]; then | ||
docker tag api "ghcr.io/whiletrue-industries/${IMAGE_NAME}:latest" &&\ | ||
docker push "ghcr.io/whiletrue-industries/${IMAGE_NAME}:latest" | ||
docker tag api "ghcr.io/kolzchut/${IMAGE_NAME}:latest" &&\ | ||
docker push "ghcr.io/kolzchut/${IMAGE_NAME}:latest" | ||
fi |