Decouple bandwidth reservations from oversubscription (#238) #40
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: Deploy Assets | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| paths: | |
| - ".github/workflows/deploy.yml" | |
| - ".gitignore" | |
| - "deploy/**" | |
| push: | |
| paths: | |
| - ".github/workflows/deploy.yml" | |
| - ".gitignore" | |
| - "deploy/**" | |
| permissions: | |
| contents: read | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: "1.25.4" | |
| cache: false | |
| - name: Install validation tools | |
| run: | | |
| set -euo pipefail | |
| python3 -m pip install --user cfn-lint | |
| - name: Validate CloudFormation | |
| run: | | |
| cfn-lint deploy/aws/cloudformation/template.yaml | |
| go test ./deploy/aws/cloudformation | |
| publish-cloudformation: | |
| runs-on: ubuntu-latest | |
| needs: validate | |
| if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main' | |
| environment: aws-publish | |
| permissions: | |
| contents: read | |
| id-token: write | |
| env: | |
| AWS_REGION: us-east-1 | |
| CLOUDFORMATION_TEMPLATE_BUCKET: kernel-hypeman-cloudformation-prod | |
| CLOUDFORMATION_TEMPLATE_KEY: v1/hypeman/template.yaml | |
| CLOUDFORMATION_TEMPLATE_SOURCE: deploy/aws/cloudformation/template.yaml | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| role-to-assume: arn:aws:iam::613957054632:role/github-actions-hypeman-cloudformation-publisher | |
| aws-region: ${{ env.AWS_REGION }} | |
| - name: Publish CloudFormation template | |
| run: | | |
| set -euo pipefail | |
| aws s3 cp \ | |
| "$CLOUDFORMATION_TEMPLATE_SOURCE" \ | |
| "s3://$CLOUDFORMATION_TEMPLATE_BUCKET/$CLOUDFORMATION_TEMPLATE_KEY" \ | |
| --content-type application/x-yaml \ | |
| --cache-control no-cache | |
| aws s3api head-object \ | |
| --bucket "$CLOUDFORMATION_TEMPLATE_BUCKET" \ | |
| --key "$CLOUDFORMATION_TEMPLATE_KEY" \ | |
| >/dev/null | |
| curl -fsSL \ | |
| "https://$CLOUDFORMATION_TEMPLATE_BUCKET.s3.$AWS_REGION.amazonaws.com/$CLOUDFORMATION_TEMPLATE_KEY" \ | |
| >/dev/null |