Skip to content

Commit

Permalink
chore: add secrets to reusable workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
nlykkei committed Jul 15, 2024
1 parent 28a355d commit befb74a
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .github/workflows/deploy-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ on:
appServiceAppName:
required: true
type: string
secrets:
AZURE_CLIENT_ID:
required: true
AZURE_TENANT_ID:
required: true
AZURE_SUBSCRIPTION_ID:
required: true

jobs:
deploy-application:
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ on:
resourceGroupName:
required: true
type: string
secrets:
AZURE_CLIENT_ID:
required: true
AZURE_TENANT_ID:
required: true
AZURE_SUBSCRIPTION_ID:
required: true

jobs:
validate:
Expand Down Expand Up @@ -86,6 +93,10 @@ jobs:
with:
environment: ${{ inputs.environment }}
appServiceAppName: ${{ needs.deploy.outputs.appServiceAppName }}
secrets:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
needs: [deploy]

# smoke-test:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ jobs:
with:
environment: test
resourceGroupName: TodoAppTest
secrets:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
needs: [build, lint]

deploy-production:
Expand All @@ -40,4 +44,8 @@ jobs:
with:
environment: production
resourceGroupName: TodoAppProd
secrets:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
needs: [deploy-test]
5 changes: 4 additions & 1 deletion .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,14 @@ jobs:
- name: Website URL
run: 'echo "Website URL 🚀: https://${{ steps.deploy.outputs.appServiceAppHostName }}" >> "${GITHUB_STEP_SUMMARY}"'


deploy-application:
name: Deploy application
uses: ./.github/workflows/deploy-app.yml
with:
environment: test
appServiceAppName: ${{ needs.deploy.outputs.appServiceAppName }}
secrets:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
needs: [deploy]

0 comments on commit befb74a

Please sign in to comment.