Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix workflows to pass secrets to actions #52

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/actions/sam-build-and-deploy-containers/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ runs:
use-installer: true
- uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_SAM_DEPLOYMENT_ROLE }}
role-to-assume: ${{ inputs.aws-role }}
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: ${{ secrets.AWS_REGION }}
aws-region: ${{ inputs.aws-region }}

# Build and deploy x86
- run: sam build -t ${{ inputs.template-file-path }} --parameter-overrides LambdaArchitecture=${{ inputs.architecture }} --parallel --cached
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/sam-build-and-deploy-native-arm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ runs:
use-installer: false # use-installer Currently supports Linux x86-64 runners. https://github.com/aws-actions/setup-sam?tab=readme-ov-file#inputs
- uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_SAM_DEPLOYMENT_ROLE }}
role-to-assume: ${{ inputs.aws-role }}
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: ${{ secrets.AWS_REGION }}
aws-region: ${{ inputs.aws-region }}

# Build and deploy ARM
# Because native apps are built in a container, and SAM CLI doesn't know how to mount extra things outside the project directory to the container, move this file manually
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/sam-build-and-deploy-native/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ runs:
use-installer: true
- uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_SAM_DEPLOYMENT_ROLE }}
role-to-assume: ${{ inputs.aws-role }}
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: ${{ secrets.AWS_REGION }}
aws-region: ${{ inputs.aws-region }}

# Build and deploy x86
# Because native apps are built in a container, and SAM CLI doesn't know how to mount extra things outside the project directory to the container, move this file manually
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/sam-build-and-deploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ runs:
use-installer: true
- uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_SAM_DEPLOYMENT_ROLE }}
role-to-assume: ${{ inputs.aws-role }}
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: ${{ secrets.AWS_REGION }}
aws-region: ${{ inputs.aws-region }}

# Build and deploy ARM
- run: sam build -t ${{ inputs.template-file-path }} --parameter-overrides LambdaArchitecture=arm64
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/net-31-otel-pipelinE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
- name: Build and Deploy
uses: ./.github/actions/sam-build-and-deploy
with:
aws-role: ${{ secrets.AWS_SAM_DEPLOYMENT_ROLE }}
aws-region: ${{ secrets.AWS_REGION }}
dotnet-version: '3.1.x'
template-file-path: ./src/NET31-OTel/template.yaml
stack-name: net-31-otel
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/net-31-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
- name: Build and Deploy
uses: ./.github/actions/sam-build-and-deploy
with:
aws-role: ${{ secrets.AWS_SAM_DEPLOYMENT_ROLE }}
aws-region: ${{ secrets.AWS_REGION }}
dotnet-version: '3.1.x'
template-file-path: ./src/NET31/template.yaml
stack-name: net-31-base
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/net-6-containers-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ jobs:
- uses: actions/checkout@v2
- name: Build and Deploy
uses: ./.github/actions/sam-build-and-deploy-containers
with:
with:
aws-role: ${{ secrets.AWS_SAM_DEPLOYMENT_ROLE }}
aws-region: ${{ secrets.AWS_REGION }}
dotnet-version: '6.x'
template-file-path: ./src/NET6Containers/template.yaml
stack-name: net-6-containers-x86-64
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/net-6-custumRuntime-pipeline-canary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ jobs:
- uses: actions/checkout@v2
- name: Build and Deploy
uses: ./.github/actions/sam-build-and-deploy-native
with:
with:
aws-role: ${{ secrets.AWS_SAM_DEPLOYMENT_ROLE }}
aws-region: ${{ secrets.AWS_REGION }}
dotnet-version: '6.x'
template-file-path: ./src/NET6CustomRuntime/template.yaml
project-directory: ./src/NET6CustomRuntime/
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/net-6-minimal-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ jobs:
- uses: actions/checkout@v2
- name: Build and Deploy
uses: ./.github/actions/sam-build-and-deploy
with:
with:
aws-role: ${{ secrets.AWS_SAM_DEPLOYMENT_ROLE }}
aws-region: ${{ secrets.AWS_REGION }}
dotnet-version: '6.x'
template-file-path: ./src/MinimalAPI/template.yaml
stack-name: net-6-minimal
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/net-6-pipeline-canary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ jobs:
- uses: actions/checkout@v2
- name: Build and Deploy
uses: ./.github/actions/sam-build-and-deploy
with:
with:
aws-role: ${{ secrets.AWS_SAM_DEPLOYMENT_ROLE }}
aws-region: ${{ secrets.AWS_REGION }}
dotnet-version: '6.x'
template-file-path: ./src/NET6/template.yaml
stack-name: net-6-base
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/net-6-pipeline.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: NET 6

permissions:
id-token: write
contents: read
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout

on:
workflow_dispatch:
Expand All @@ -13,9 +13,6 @@ on:
- src/NET6/**
env:
AWS_REGION : eu-west-1
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout

jobs:
build-deploy:
Expand All @@ -25,7 +22,9 @@ jobs:
uses: actions/checkout@v2
- name: Build and Deploy
uses: ./.github/actions/sam-build-and-deploy
with:
with:
aws-role: ${{ secrets.AWS_SAM_DEPLOYMENT_ROLE }}
aws-region: ${{ secrets.AWS_REGION }}
dotnet-version: '6.x'
template-file-path: ./src/NET6/template.yaml
stack-name: net-6-base
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/net-6-top-level-statements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ jobs:
- uses: actions/checkout@v2
- name: Build and Deploy
uses: ./.github/actions/sam-build-and-deploy
with:
with:
aws-role: ${{ secrets.AWS_SAM_DEPLOYMENT_ROLE }}
aws-region: ${{ secrets.AWS_REGION }}
dotnet-version: '6.x'
template-file-path: ./src/NET6TopLevelStatements/template.yaml
stack-name: net-6-top-level
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/net-6-with-power-tools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ jobs:
- uses: actions/checkout@v2
- name: Build and Deploy
uses: ./.github/actions/sam-build-and-deploy
with:
with:
aws-role: ${{ secrets.AWS_SAM_DEPLOYMENT_ROLE }}
aws-region: ${{ secrets.AWS_REGION }}
dotnet-version: '6.x'
template-file-path: ./src/NET6WithPowerTools/template.yaml
stack-name: net-6-power-tools
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/net-7-native-aot-canary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
- name: Build and Deploy
uses: ./.github/actions/sam-build-and-deploy-native
with:
aws-role: ${{ secrets.AWS_SAM_DEPLOYMENT_ROLE }}
aws-region: ${{ secrets.AWS_REGION }}
dotnet-version: '7.x'
template-file-path: ./src/NET7Native/template.yaml
project-directory: ./src/NET7Native/
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/net-7-native-aot-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
- name: Build and Deploy
uses: ./.github/actions/sam-build-and-deploy-native
with:
aws-role: ${{ secrets.AWS_SAM_DEPLOYMENT_ROLE }}
aws-region: ${{ secrets.AWS_REGION }}
dotnet-version: '7.x'
template-file-path: ./src/NET7Native/template.yaml
project-directory: ./src/NET7Native/
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/net-7-pipeline-canary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
- name: Build and Deploy
uses: ./.github/actions/sam-build-and-deploy-native
with:
aws-role: ${{ secrets.AWS_SAM_DEPLOYMENT_ROLE }}
aws-region: ${{ secrets.AWS_REGION }}
dotnet-version: '7.x'
template-file-path: ./src/NET7/template.yaml
project-directory: ./src/NET7/
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/net-7-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
- name: Build and Deploy
uses: ./.github/actions/sam-build-and-deploy-native
with:
aws-role: ${{ secrets.AWS_SAM_DEPLOYMENT_ROLE }}
aws-region: ${{ secrets.AWS_REGION }}
dotnet-version: '7.x'
template-file-path: ./src/NET7/template.yaml
project-directory: ./src/NET7/
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/net-8-native-aot-pipeline-canary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
- name: Build and Deploy
uses: ./.github/actions/sam-build-and-deploy-native
with:
aws-role: ${{ secrets.AWS_SAM_DEPLOYMENT_ROLE }}
aws-region: ${{ secrets.AWS_REGION }}
dotnet-version: '8.x'
template-file-path: ./src/NET8Native/template.yaml
project-directory: ./src/NET8Native/
Expand All @@ -34,8 +36,7 @@ jobs:
- name: Build and Deploy ARM
uses: ./.github/actions/sam-build-and-deploy-native-arm
with:
aws-access-key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-role: ${{ secrets.AWS_SAM_DEPLOYMENT_ROLE }}
aws-region: ${{ secrets.AWS_REGION }}
dotnet-version: '8.x'
template-file-path: ./src/NET8Native/template.yaml
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/net-8-native-aot-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
- name: Build and Deploy
uses: ./.github/actions/sam-build-and-deploy-native
with:
aws-role: ${{ secrets.AWS_SAM_DEPLOYMENT_ROLE }}
aws-region: ${{ secrets.AWS_REGION }}
dotnet-version: '8.x'
template-file-path: ./src/NET8Native/template.yaml
project-directory: ./src/NET8Native/
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/net-8-pipeline-canary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
- name: Build and Deploy
uses: ./.github/actions/sam-build-and-deploy
with:
aws-role: ${{ secrets.AWS_SAM_DEPLOYMENT_ROLE }}
aws-region: ${{ secrets.AWS_REGION }}
dotnet-version: '8.x'
template-file-path: ./src/NET8/template.yaml
project-directory: ./src/NET8/
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/net-8-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
- name: Build and Deploy
uses: ./.github/actions/sam-build-and-deploy
with:
aws-role: ${{ secrets.AWS_SAM_DEPLOYMENT_ROLE }}
aws-region: ${{ secrets.AWS_REGION }}
dotnet-version: '8.x'
template-file-path: ./src/NET8/template.yaml
stack-name: net-8-base
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/net-9-pipeline-canary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
- name: Build and Deploy
uses: ./.github/actions/sam-build-and-deploy-native
with:
aws-role: ${{ secrets.AWS_SAM_DEPLOYMENT_ROLE }}
aws-region: ${{ secrets.AWS_REGION }}
dotnet-version: '9.x'
template-file-path: ./src/NET9CustomRuntime/template.yaml
project-directory: ./src/NET9CustomRuntime/
Expand All @@ -31,9 +33,8 @@ jobs:
- uses: actions/checkout@v2
- name: Build and Deploy
uses: ./.github/actions/sam-build-and-deploy-native-arm
with:
aws-access-key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
with:
aws-role: ${{ secrets.AWS_SAM_DEPLOYMENT_ROLE }}
aws-region: ${{ secrets.AWS_REGION }}
dotnet-version: '9.x'
template-file-path: ./src/NET9CustomRuntime/template.yaml
Expand Down
Loading