Skip to content

1.1.14

1.1.14 #19

Workflow file for this run

name: Released
on:
release:
types:
- released
env:
COMPONENT: authentication-service
COMPONENT_PATH: apps
PRIVATE_ECR_REGION: ${{ secrets.AWS_ECR_REGION }}
ECR_ROLE_ARN: ${{ secrets.AWS_ECR_ROLE_ARN }}
CONTAINER: authentication-service-container-image
DOCKER_REPOSITORY: authentication-service
permissions:
id-token: write
contents: read
packages: read
jobs:
cancel_previous:
name: 'Cancel Previous Runs'
runs-on:
#- self-hosted
#- small
- ubuntu-22.04
timeout-minutes: 3
steps:
- uses: ydataai/[email protected]
with:
ignore_sha: true
access_token: ${{ secrets.ACCESS_TOKEN }}
prepare:
name: Prepare
runs-on:
#- self-hosted
#- small
- ubuntu-22.04
needs:
- cancel_previous
outputs:
build_number: ${{ steps.short_sha.outputs.value }}
version: ${{ steps.version.outputs.value }}
steps:
- name: Version
id: version
run: echo "value=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- uses: actions/checkout@v4
- name: Git Short sha
id: short_sha
run: echo "value=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
docker-tag:
name: Docker Tag and Push
runs-on:
#- self-hosted
#- medium
- ubuntu-22.04
needs:
- prepare
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.ECR_ROLE_ARN }}
aws-region: ${{ env.PRIVATE_ECR_REGION }}
- name: Login to Amazon ECR
id: ecr_password
uses: aws-actions/amazon-ecr-login@v2
- name: Docker tag release
env:
REPOSITORY: ${{ env.DOCKER_REPOSITORY }}
TAG: ${{ needs.prepare.outputs.version }}.${{ needs.prepare.outputs.build_number }}
NEW_TAG: ${{ needs.prepare.outputs.version }}
run: |
MANIFEST=$(aws ecr batch-get-image --repository-name $REPOSITORY --image-ids imageTag=$TAG --query 'images[].imageManifest' --output text)
aws ecr put-image --repository-name $REPOSITORY --image-tag $NEW_TAG --image-manifest "$MANIFEST"
update-manifests:
name: Update Manifests
runs-on:
#- self-hosted
#- small
- ubuntu-22.04
needs:
- prepare
- docker-tag
steps:
- name: Checkout Manifests repo
uses: actions/checkout@v4
with:
repository: ydataai/manifests
token: ${{ secrets.ACCESS_TOKEN }}
- uses: imranismail/setup-kustomize@v2
with:
kustomize-version: ${{ secrets.KUSTOMIZE_VERSION }}
- name: Update kustomization image tag
env:
VERSION: ${{ needs.prepare.outputs.version }}
run: |
cd ${COMPONENT_PATH}/
kustomize edit set image ${CONTAINER}=${DOCKER_REPOSITORY}:${VERSION}
- name: Commit and push image update into manifests repo
env:
VERSION: ${{ needs.prepare.outputs.version }}
run: |
git config user.email "[email protected]"
git config user.name "Azory YData Bot"
git commit -a -m "chore(bump): [CI] [PROD] bump ${{ env.COMPONENT }} to $VERSION"
git push origin master