Deploy to Elastic Beanstalk with OIDC #9
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
name: Deploy to Elastic Beanstalk with OIDC | |
on: | |
workflow_run: | |
workflows: ["Lint, Static Analysis, Tests"] | |
branches: | |
- "main" | |
types: | |
- completed | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
deploy: | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github_oidc_link_eb_deploy | |
aws-region: ap-southeast-1 | |
- name: Install Python 3.11 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install EB CLI | |
run: | | |
python -m pip install --upgrade pip | |
pip install awsebcli | |
- name: Deploy to Elastic Beanstalk | |
run: eb deploy |