Skip to content

Commit

Permalink
Use git sha to deploy staging env
Browse files Browse the repository at this point in the history
  • Loading branch information
kbeaugrand committed May 31, 2023
1 parent 5e27ccb commit e9fc6e7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/aws_deploy_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit e9fc6e7

Please sign in to comment.