Skip to content

Create main.yml

Create main.yml #1

Workflow file for this run

name: Demo Workflow
on:
push:
branches:
- main
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ vars.AWS_DEFAULT_REGION }}
ECR_REPOSITORY_NAME: ${{ vars.ECR_REPOSITORY_NAME }}
jobs:
push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ env.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- uses: aws-actions/amazon-ecr-login@v2
- uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ env.ECR_REPOSITORY_NAME }}:${{ github.sha }}