Keep it secret, keep it safe #4
Workflow file for this run
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: Publish Regional Templates | |
on: | |
push: | |
tags: | |
- v1.* | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
strategy: | |
matrix: | |
include: | |
- region: us-east-1 | |
region-name: US East (N. Virginia) | |
aws-account-id: "080825576347" | |
aws-partition: aws | |
- region: us-east-2 | |
region-name: US East (Ohio) | |
aws-account-id: "080825576347" | |
aws-partition: aws | |
- region: us-west-1 | |
region-name: US West (N. California) | |
aws-account-id: "080825576347" | |
aws-partition: aws | |
- region: us-west-2 | |
region-name: US West (Oregon) | |
aws-account-id: "080825576347" | |
aws-partition: aws | |
- region: af-south-1 | |
region-name: Africa (Cape Town) | |
aws-account-id: "080825576347" | |
aws-partition: aws | |
- region: ap-east-1 | |
region-name: Asia Pacific (Hong Kong) | |
aws-account-id: "080825576347" | |
aws-partition: aws | |
- region: ap-south-2 | |
region-name: Asia Pacific (Hyderabad) | |
aws-account-id: "080825576347" | |
aws-partition: aws | |
- region: ap-southeast-3 | |
region-name: Asia Pacific (Jakarta) | |
aws-account-id: "080825576347" | |
aws-partition: aws | |
- region: ap-southeast-4 | |
region-name: Asia Pacific (Melbourne) | |
aws-account-id: "080825576347" | |
aws-partition: aws | |
- region: ap-south-1 | |
region-name: Asia Pacific (Mumbai) | |
aws-account-id: "080825576347" | |
aws-partition: aws | |
- region: ap-northeast-3 | |
region-name: Asia Pacific (Osaka) | |
aws-account-id: "080825576347" | |
aws-partition: aws | |
- region: ap-northeast-2 | |
region-name: Asia Pacific (Seoul) | |
aws-account-id: "080825576347" | |
aws-partition: aws | |
- region: ap-southeast-1 | |
region-name: Asia Pacific (Singapore) | |
aws-account-id: "080825576347" | |
aws-partition: aws | |
- region: ap-southeast-2 | |
region-name: Asia Pacific (Sydney) | |
aws-account-id: "080825576347" | |
aws-partition: aws | |
- region: ap-northeast-1 | |
region-name: Asia Pacific (Tokyo) | |
aws-account-id: "080825576347" | |
aws-partition: aws | |
- region: ca-central-1 | |
region-name: Canada (Central) | |
aws-account-id: "080825576347" | |
aws-partition: aws | |
- region: ca-west-1 | |
region-name: Canada (Calgary) | |
aws-account-id: "080825576347" | |
aws-partition: aws | |
- region: eu-central-1 | |
region-name: Europe (Frankfurt) | |
aws-account-id: "080825576347" | |
aws-partition: aws | |
- region: eu-west-1 | |
region-name: Europe (Ireland) | |
aws-account-id: "080825576347" | |
aws-partition: aws | |
- region: eu-west-2 | |
region-name: Europe (London) | |
aws-account-id: "080825576347" | |
aws-partition: aws | |
- region: eu-south-1 | |
region-name: Europe (Milan) | |
aws-account-id: "080825576347" | |
aws-partition: aws | |
- region: eu-west-3 | |
region-name: Europe (Paris) | |
aws-account-id: "080825576347" | |
aws-partition: aws | |
- region: eu-south-2 | |
region-name: Europe (Spain) | |
aws-account-id: "080825576347" | |
aws-partition: aws | |
- region: eu-north-1 | |
region-name: Europe (Stockholm) | |
aws-account-id: "080825576347" | |
aws-partition: aws | |
- region: eu-central-2 | |
region-name: Europe (Zurich) | |
aws-account-id: "080825576347" | |
aws-partition: aws | |
- region: il-central-1 | |
region-name: Israel (Tel Aviv) | |
aws-account-id: "080825576347" | |
aws-partition: aws | |
- region: me-south-1 | |
region-name: Middle East (Bahrain) | |
aws-account-id: "080825576347" | |
aws-partition: aws | |
- region: me-central-1 | |
region-name: Middle East (UAE) | |
aws-account-id: "080825576347" | |
aws-partition: aws | |
- region: sa-east-1 | |
region-name: South America (São Paulo) | |
aws-account-id: "080825576347" | |
aws-partition: aws | |
- region: us-gov-east-1 | |
region-name: US East | |
aws-account-id: "282774566237" | |
aws-partition: aws-us-gov | |
- region: us-gov-west-1 | |
region-name: US West | |
aws-account-id: "282774566237" | |
aws-partition: aws-us-gov | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
check-latest: true | |
- run: make build --always-make | |
- uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: arn:${{ matrix.aws-partition }}:iam::${{ matrix.aws-account-id }}:role/GitHubActionsJWTIssuerStackTemplatesRole | |
aws-region: ${{ matrix.region }} | |
- uses: aws-actions/setup-sam@v2 | |
with: | |
use-installer: true | |
- run: | | |
sam package \ | |
--template template.yml \ | |
--s3-bucket jwt-issuer-stack-templates-${{ matrix.region }} \ | |
--s3-prefix jwt-issuer-${{ github.ref_name }} \ | |
--output-template-file jwt-issuer-packaged.yml \ | |
--region ${{ matrix.region }} | |
env: | |
SAM_CLI_TELEMETRY: "0" | |
- run: | | |
aws s3 cp \ | |
jwt-issuer-packaged.yml \ | |
s3://jwt-issuer-stack-templates-${{ matrix.region }}/jwt-issuer-v1.x.yml \ | |
--region ${{ matrix.region }} | |
aws s3 cp \ | |
jwt-issuer-packaged.yml \ | |
s3://jwt-issuer-stack-templates-${{ matrix.region }}/jwt-issuer-${{ github.ref_name }}.yml \ | |
--region ${{ matrix.region }} |