Fix image tag for GitHubActions #8
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
## Before usage manually deploy github-oidc.yaml CloudFormation template to us-east-1 | |
## Set secrets.AWS_ROLE_ARN Github secret to name of the role cretaed by the template above | |
name: Deploy to Amazon ECS | |
on: | |
push: | |
branches: [ "main" ] | |
env: | |
AWS_REGION: us-east-1 | |
permissions: | |
id-token: write | |
contents: write | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
environment: production | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- uses: aws-actions/setup-sam@v2 | |
with: | |
use-installer: true | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-region: us-east-1 | |
role-to-assume: ${{ secrets.AWS_ROLE_ARN }} | |
role-session-name: Github-Actions | |
- name: Login to Amazon ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v1 | |
- name: Test Env | |
id: testenv | |
env: | |
IMAGE_TAG: b${{ github.run_number }}a${{ github.run_attempt }}-${{ github.sha }} | |
run: | | |
./deploy-dev.sh |