From e9fc6e7565852900dd3caf2c342b24a6ab7554b6 Mon Sep 17 00:00:00 2001 From: Kevin BEAUGRAND Date: Wed, 31 May 2023 15:13:48 +0200 Subject: [PATCH] Use git sha to deploy staging env --- .github/workflows/aws_deploy_staging.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/aws_deploy_staging.yml b/.github/workflows/aws_deploy_staging.yml index 60817ce50..fad1eded0 100644 --- a/.github/workflows/aws_deploy_staging.yml +++ b/.github/workflows/aws_deploy_staging.yml @@ -59,8 +59,7 @@ jobs: ${{ steps.login-ecr.outputs.registry }}/${{ vars.AWS_ECR_REPOSITORY }} tags: | type=raw,enable=true,priority=200,prefix=,suffix=,value=${{ steps.final-version.outputs.new_version }} - flavor: | - latest=true + type=sha,enable=true,priority=100,prefix=sha-,suffix=,format=short - name: Build and push # You may pin to the exact commit or the version. @@ -95,6 +94,11 @@ jobs: id: login-ecr uses: aws-actions/amazon-ecr-login@v1 + - name: Get git short sha + shell: bash + run: | + echo "LAST_COMMIT_SHA=${GITHUB_SHA:0:7}" >> ${GITHUB_ENV} + - name: Deploy to App Runner Image id: deploy-apprunner uses: awslabs/amazon-app-runner-deploy@main @@ -112,7 +116,7 @@ jobs: LORAFEATURE__ENABLED: ${{ vars.LORAFEATURE_ENABLED }} with: service: ${{ vars.AWS_APP_RUNNER_NAME }} - image: ${{ steps.login-ecr.outputs.registry }}/${{ vars.AWS_ECR_REPOSITORY }}:latest + image: ${{ steps.login-ecr.outputs.registry }}/${{ vars.AWS_ECR_REPOSITORY }}:sha-${{LAST_COMMIT_SHA}} access-role-arn: ${{ secrets.AWS_ROLE_ARN }} region: ${{ secrets.AWS_REGION }} cpu : 1