繁体   English   中英

Github 动作将 django 应用程序部署到弹性 beanstalk

[英]Github actions deploy django application to elastic beanstalk

我只是想使用 github 操作将我的 django 应用程序部署到弹性 beanstalk,但不断收到这些错误:

Warning: Environment update finished, but health is Red and health status is Degraded. Giving it 30 seconds to recover...
Warning: Environment still has health: Red and health status Degraded. Waiting 19 more seconds before failing...
Warning: Environment still has health: Red and health status Degraded. Waiting 8 more seconds before failing...
Error: Deployment failed: Error: Environment still has health Red 30 seconds after update finished!

这是我在下面使用的代码:

name: AWS Deploy
on:
  push:
    branches:
      - test-main-branch

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout source code
        uses: actions/checkout@v2

  - name: Generate deployment package
    run: zip -r deploy.zip . -x '*.git*'

  - name: Get timestamp
    uses: gerred/actions/current-time@master
    id: current-time

  - name: Run string replace
    uses: frabert/replace-string-action@master
    id: format-time
    with:
      pattern: '[:\.]+'
      string: "${{ steps.current-time.outputs.time }}"
      replace-with: "-"
      flags: "g"

  - name: Deploy to EB
    uses: einaregilsson/beanstalk-deploy@v20
    with:
      aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
      aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
      application_name: project-pit
      environment_name: project-pit-cloud
      version_label: 12345
      region: ap-southeast-2
      deployment_package: deploy.zip

  - name: Deployed!
    run: echo App deployed

该应用程序出现在我的 s3 存储桶中,但我的弹性豆茎上的健康状况仍然下降。

我还应该提到我的 s3 bucket 不止一层深,bucket/project-pit

    uses: einaregilsson/beanstalk-deploy@v20
    with:
      aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
      aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
      application_name: project-pit
      environment_name: project-pit-cloud
      version_label: 12345
      region: ap-southeast-2
      deployment_package: deploy.zip
      wait_for_environment_recovery: 60

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM