Deployment #81
Workflow file for this run
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: Deployment | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build_package_and_deploy: | |
| name: Build, package and deploy | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 90 | |
| env: | |
| AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION_DEPLOY }} | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_DEPLOY }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_DEPLOY }} | |
| AWS_DEFAULT_ACCOUNT: ${{ secrets.AWS_ACCOUNT_ID }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| cache: "npm" | |
| - name: Install All Dependencies | |
| run: npm run install:all | |
| - name: Compile project | |
| run: npm run build | |
| - name: Generate distribution packages | |
| run: npm run package | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v3 | |
| with: | |
| version: "0.7.*" | |
| enable-cache: true | |
| - name: Install deployment environment | |
| id: install_deploy_env | |
| run: | | |
| # install deployment environment with eoapi-cdk from build | |
| uv sync --group deploy | |
| uv pip install dist/python/*.gz | |
| cd integration_tests/cdk | |
| npm install | |
| cd - | |
| # use short commit SHA to name stacks | |
| - uses: benjlevesque/short-sha@v3.0 | |
| id: short-sha | |
| with: | |
| length: 6 | |
| - name: Deploy test stack | |
| id: deploy_step | |
| env: | |
| PROJECT_ID: ${{ steps.short-sha.outputs.sha }} | |
| run: | | |
| # synthesize the stack | |
| cd integration_tests/cdk | |
| uv run npx cdk synth --debug --all --require-approval never | |
| # deploy the stack | |
| uv run npx cdk deploy --ci --all --require-approval never | |
| cd - | |
| - name: Tear down any infrastructure | |
| if: always() | |
| env: | |
| PROJECT_ID: ${{ steps.short-sha.outputs.sha }} | |
| run: | | |
| cd integration_tests/cdk | |
| # run this only if we find a 'cdk.out' directory, which means there might be things to tear down | |
| if [ -d "cdk.out" ]; then | |
| cd - | |
| cd integration_tests/cdk | |
| # see https://github.com/aws/aws-cdk/issues/24946 | |
| # this didn't work : rm -f cdk.out/synth.lock | |
| # so we just duplicate the cdk output to cdk-destroy.out | |
| uv run npx cdk destroy --output cdk-destroy.out --ci --all --force | |
| fi |