fixed relative imports #188
This file contains hidden or 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: CD | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| - homolog | |
| - prod | |
| workflow_dispatch: | |
| jobs: | |
| DeployToAWS: | |
| environment: | |
| name: ${{ github.ref_name }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Python 3.13 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - name: Set AWS Account ID and other variables | |
| run: | | |
| if [[ "${{ github.ref_name }}" == "dev" ]]; then | |
| echo "AWS_ACCOUNT_ID=${{ secrets.AWS_ACCOUNT_ID_DEV }}" >> $GITHUB_ENV | |
| elif [[ "${{ github.ref_name }}" == "homolog" ]]; then | |
| echo "AWS_ACCOUNT_ID=${{ secrets.AWS_ACCOUNT_ID_HOML }}" >> $GITHUB_ENV | |
| elif [[ "${{ github.ref_name }}" == "prod" ]]; then | |
| echo "AWS_ACCOUNT_ID=${{ secrets.AWS_ACCOUNT_ID_PROD }}" >> $GITHUB_ENV | |
| else | |
| echo "Invalid branch name!" && exit 1 | |
| fi | |
| echo "STACK_NAME=DevMediasStack${{github.ref_name}}" >> $GITHUB_ENV | |
| - name: Setup AWS Credentials | |
| uses: aws-actions/configure-aws-credentials@v4 # --> ATUALIZADO | |
| with: | |
| aws-region: ${{ vars.AWS_REGION }} | |
| role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT_ID }}:role/GithubActionsRole | |
| role-session-name: github-action | |
| - name: Installing Dependencies | |
| run: | | |
| npm install -g aws-cdk | |
| cd iac | |
| pip install -r requirements-infra.txt | |
| - name: DeployWithCDK | |
| run: | | |
| cd iac | |
| cdk synth | |
| cdk deploy --require-approval never | |
| env: | |
| AWS_ACCOUNT_ID: ${{ env.AWS_ACCOUNT_ID }} | |
| AWS_REGION: ${{ vars.AWS_REGION }} | |
| STACK_NAME: ${{ env.STACK_NAME }} | |
| GITHUB_REF_NAME: ${{ github.ref_name }} | |
| FROM_EMAIL: ${{ vars.FROM_EMAIL }} | |
| HIDDEN_COPY: ${{ vars.HIDDEN_COPY }} | |
| REPLY_TO_EMAIL: ${{ vars.REPLY_TO_EMAIL }} |