

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# GitHub 작업을 사용하여 Elastic Beanstalk에 배포
<a name="deploying-github-actions"></a>

[GitHub Actions](https://docs.github.com/en/actions)는 코드 변경 사항을 리포지토리에 푸시할 때 애플리케이션을 Elastic Beanstalk에 자동으로 배포할 수 있습니다. [Elastic Beanstalk Deploy](https://github.com/aws-actions/aws-elasticbeanstalk-deploy) 작업은 애플리케이션 버전 생성, Amazon S3에 소스 번들 업로드, Elastic Beanstalk 환경에 배포를 처리하는 간단한 YAML 인터페이스를 제공합니다.

## 워크플로 예제
<a name="deploying-github-actions-example"></a>

다음 예제 워크플로는 `main`브랜치로 푸시할 때마다 애플리케이션을 Elastic Beanstalk 환경에 배포합니다. 의 `.github/workflows/` 리포지토리에 `.yml` 파일을 생성합니다.

**Example Elastic Beanstalk 배포를 위한 GitHub Actions 워크플로**  

```
name: Deploy to Elastic Beanstalk

on:
  push:
    branches:
      - main

permissions:
  id-token: write
  contents: read

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Configure AWS credentials
        uses: aws-actions/configure-aws-credentials@v4
        with:
          role-to-assume: arn:aws:iam::{{123456789012}}:role/{{my-github-actions-role}}
          aws-region: {{us-east-1}}

      - name: Deploy to Elastic Beanstalk
        uses: aws-actions/aws-elasticbeanstalk-deploy@v1.0.0
        with:
          aws-region: {{us-east-1}}
          application-name: {{my-application}}
          environment-name: {{my-application-env}}
```

이 워크플로는 리포지토리를 확인하고, [OpenID Connect(OIDC)](https://docs.github.com/en/actions/security-for-github-actions/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services)를 사용하여 [자격 증명 구성 AWS](https://github.com/aws-actions/configure-aws-credentials) 작업을 AWS 통해를 인증한 다음 애플리케이션을 Elastic Beanstalk에 배포합니다. 배포 작업은 리포지토리 콘텐츠를 패키징하고, 소스 번들을 Amazon S3에 업로드하고, 새 애플리케이션 버전을 생성하고, 환경을 생성하거나 업데이트합니다. 기본적으로 배포가 완료되고 환경이 정상 상태로 돌아갈 때까지 기다립니다.

자세한 구성 옵션과 고급 예제는 GitHub의 [Elastic Beanstalk Deploy 작업 README](https://github.com/aws-actions/aws-elasticbeanstalk-deploy#readme)를 참조하세요.

## 추가 리소스
<a name="deploying-github-actions-resources"></a>
+ GitHub의 [Elastic Beanstalk 배포 작업](https://github.com/aws-actions/aws-elasticbeanstalk-deploy) 
+ GitHub에서[AWS 자격 증명 작업 구성](https://github.com/aws-actions/configure-aws-credentials) 
+ [Amazon Web Services에서 OpenID Connect 구성](https://docs.github.com/en/actions/security-for-github-actions/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services)(GitHub 설명서)